From 935c72c6c378244886e2a6da7547fb3dadd13aef Mon Sep 17 00:00:00 2001 From: GSzabados <35445496+GSzabados@users.noreply.github.com> Date: Mon, 21 Sep 2020 13:10:55 +0200 Subject: [PATCH] Update __init__.py Fixing change of UNIT_PERCENTAGE to PERCENTAGE at HA version 115 - https://github.com/home-assistant/core/issues/40207 - Issue #23 Fixing typo in TYPE_MAXDAILYGUSTKMH to display as SPEED_KILOMETERS_PER_HOUR - Issue #20 --- custom_components/ecowitt/__init__.py | 40 +++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/custom_components/ecowitt/__init__.py b/custom_components/ecowitt/__init__.py index fc3ae77..4a8b63d 100644 --- a/custom_components/ecowitt/__init__.py +++ b/custom_components/ecowitt/__init__.py @@ -29,7 +29,7 @@ CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, POWER_WATT, TEMP_CELSIUS, - UNIT_PERCENTAGE, + PERCENTAGE, PRESSURE_HPA, PRESSURE_INHG, LENGTH_INCHES, @@ -228,34 +228,34 @@ TYPE_SENSOR, None, "mdi:water", S_METRIC), TYPE_YEARLYRAINMM: ("Yearly Rain Rate", f"mm/{TIME_YEARS}", TYPE_SENSOR, None, "mdi:water", S_METRIC), - TYPE_HUMIDITY: ("Humidity", UNIT_PERCENTAGE, + TYPE_HUMIDITY: ("Humidity", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_HUMIDITYIN: ("Indoor Humidity", UNIT_PERCENTAGE, + TYPE_HUMIDITYIN: ("Indoor Humidity", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_HUMIDITY1: ("Humidity 1", UNIT_PERCENTAGE, + TYPE_HUMIDITY1: ("Humidity 1", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_HUMIDITY2: ("Humidity 2", UNIT_PERCENTAGE, + TYPE_HUMIDITY2: ("Humidity 2", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_HUMIDITY3: ("Humidity 3", UNIT_PERCENTAGE, + TYPE_HUMIDITY3: ("Humidity 3", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_HUMIDITY4: ("Humidity 4", UNIT_PERCENTAGE, + TYPE_HUMIDITY4: ("Humidity 4", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_HUMIDITY5: ("Humidity 5", UNIT_PERCENTAGE, + TYPE_HUMIDITY5: ("Humidity 5", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_HUMIDITY6: ("Humidity 6", UNIT_PERCENTAGE, + TYPE_HUMIDITY6: ("Humidity 6", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_HUMIDITY7: ("Humidity 7", UNIT_PERCENTAGE, + TYPE_HUMIDITY7: ("Humidity 7", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_HUMIDITY8: ("Humidity 8", UNIT_PERCENTAGE, + TYPE_HUMIDITY8: ("Humidity 8", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), TYPE_WINDDIR: ("Wind Direction", DEGREE, @@ -277,7 +277,7 @@ TYPE_SENSOR, None, "mdi:weather-windy", S_IMPERIAL), TYPE_MAXDAILYGUST: ("Max Daily Wind Gust", SPEED_MILES_PER_HOUR, TYPE_SENSOR, None, "mdi:weather-windy", S_IMPERIAL), - TYPE_MAXDAILYGUSTKMH: ("Max Daily Wind Gust", SPEED_MILES_PER_HOUR, + TYPE_MAXDAILYGUSTKMH: ("Max Daily Wind Gust", SPEED_KILOMETERS_PER_HOUR, TYPE_SENSOR, None, "mdi:weather-windy", S_METRIC), TYPE_TEMPC: ("Outdoor Temperature", TEMP_CELSIUS, TYPE_SENSOR, DEVICE_CLASS_TEMPERATURE, "mdi:thermometer", 0), @@ -338,28 +338,28 @@ "mdi:weather-sunny", 0), TYPE_UV: ("UV Index", UV_INDEX, TYPE_SENSOR, None, "mdi:sunglasses", 0), - TYPE_SOILMOISTURE1: ("Soil Moisture 1", UNIT_PERCENTAGE, + TYPE_SOILMOISTURE1: ("Soil Moisture 1", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_SOILMOISTURE2: ("Soil Moisture 2", UNIT_PERCENTAGE, + TYPE_SOILMOISTURE2: ("Soil Moisture 2", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_SOILMOISTURE3: ("Soil Moisture 3", UNIT_PERCENTAGE, + TYPE_SOILMOISTURE3: ("Soil Moisture 3", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_SOILMOISTURE4: ("Soil Moisture 4", UNIT_PERCENTAGE, + TYPE_SOILMOISTURE4: ("Soil Moisture 4", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_SOILMOISTURE5: ("Soil Moisture 5", UNIT_PERCENTAGE, + TYPE_SOILMOISTURE5: ("Soil Moisture 5", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_SOILMOISTURE6: ("Soil Moisture 6", UNIT_PERCENTAGE, + TYPE_SOILMOISTURE6: ("Soil Moisture 6", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_SOILMOISTURE7: ("Soil Moisture 7", UNIT_PERCENTAGE, + TYPE_SOILMOISTURE7: ("Soil Moisture 7", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), - TYPE_SOILMOISTURE8: ("Soil Moisture 8", UNIT_PERCENTAGE, + TYPE_SOILMOISTURE8: ("Soil Moisture 8", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_HUMIDITY, "mdi:water-percent", 0), TYPE_PM25_CH1: ("PM2.5 1", CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,