From 9bb315c472bd51b2a1e6328a151a1d7c331eb3d5 Mon Sep 17 00:00:00 2001 From: Kev Date: Sun, 28 Apr 2024 20:10:27 +0000 Subject: [PATCH] Finish setup of sensors for V2 features --- .gitignore | 5 +++++ custom_components/pirateweather/const.py | 7 +++++++ custom_components/pirateweather/manifest.json | 16 ++++++++++------ custom_components/pirateweather/sensor.py | 4 ++++ scripts/develop | 0 scripts/setup | 0 6 files changed, 26 insertions(+), 6 deletions(-) mode change 100644 => 100755 scripts/develop mode change 100644 => 100755 scripts/setup diff --git a/.gitignore b/.gitignore index 13b6f67..566cd66 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,8 @@ pythonenv* venv .venv .coverage +*.db* +*.log* +.HA_VERSION +config/.storage/* +config/blueprints/* diff --git a/custom_components/pirateweather/const.py b/custom_components/pirateweather/const.py index 6c00d1a..da0998e 100644 --- a/custom_components/pirateweather/const.py +++ b/custom_components/pirateweather/const.py @@ -116,6 +116,13 @@ "nearest_storm_bearing": "Nearest Storm Bearing", "alerts": "Alerts", "time": "Time", + "fire_index": "Fire Index", + "fire_index_max": "Fire Index Max", + "smoke": "Smoke", + "smoke_max": "Smoke Max", + "liquid_accumulation": "Liquid Accumulation", + "snow_accumulation": "Snow Accumulation", + "ice_accumulation": "Ice Accumulation", } LANGUAGES = [ diff --git a/custom_components/pirateweather/manifest.json b/custom_components/pirateweather/manifest.json index 52fb2dd..c73c9c8 100644 --- a/custom_components/pirateweather/manifest.json +++ b/custom_components/pirateweather/manifest.json @@ -1,12 +1,16 @@ { "domain": "pirateweather", "name": "Pirate Weather", - "codeowners": ["@alexander0042"], + "codeowners": [ + "@alexander0042" + ], "config_flow": true, - "dependencies": [], + "dependencies": [], "documentation": "https://github.com/alexander0042/pirate-weather-ha", "iot_class": "cloud_polling", - "issue_tracker": "https://github.com/alexander0042/pirate-weather-ha/issues", - "requirements": ["python-forecastio==1.4.0"], - "version": "1.4.5.1" -} + "issue_tracker": "https://github.com/alexander0042/pirate-weather-ha/issues", + "requirements": [ + "python-forecastio==1.4.0" + ], + "version": "1.5" +} \ No newline at end of file diff --git a/custom_components/pirateweather/sensor.py b/custom_components/pirateweather/sensor.py index 4ccb114..49a47b2 100644 --- a/custom_components/pirateweather/sensor.py +++ b/custom_components/pirateweather/sensor.py @@ -377,6 +377,7 @@ class PirateWeatherSensorEntityDescription(SensorEntityDescription): name="Fire Index", state_class=None, suggested_display_precision=2, + icon="mdi:fire", forecast_mode=["currently", "hourly"], ), "fire_index_max": PirateWeatherSensorEntityDescription( @@ -384,6 +385,7 @@ class PirateWeatherSensorEntityDescription(SensorEntityDescription): name="Fire Index Max", state_class=None, suggested_display_precision=2, + icon="mdi:fire", forecast_mode=["daily"], ), "smoke": PirateWeatherSensorEntityDescription( @@ -391,6 +393,7 @@ class PirateWeatherSensorEntityDescription(SensorEntityDescription): name="Smoke", state_class=SensorDeviceClass.PM25, suggested_display_precision=2, + icon="mdi:smoke", forecast_mode=["currently", "hourly"], ), "smoke_max": PirateWeatherSensorEntityDescription( @@ -398,6 +401,7 @@ class PirateWeatherSensorEntityDescription(SensorEntityDescription): name="Smoke Max", state_class=SensorDeviceClass.PM25, suggested_display_precision=2, + icon="mdi:smoke", forecast_mode=["daily"], ), "apparent_temperature_max": PirateWeatherSensorEntityDescription( diff --git a/scripts/develop b/scripts/develop old mode 100644 new mode 100755 diff --git a/scripts/setup b/scripts/setup old mode 100644 new mode 100755