From 8a3a33881eed5e55b75017e7453b1f255d51fd35 Mon Sep 17 00:00:00 2001 From: garbled1 Date: Sat, 16 Oct 2021 06:46:54 -0700 Subject: [PATCH] Fix binary sensors state_class to be None --- custom_components/ecowitt/const.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/custom_components/ecowitt/const.py b/custom_components/ecowitt/const.py index e30e9f3..e57fc40 100644 --- a/custom_components/ecowitt/const.py +++ b/custom_components/ecowitt/const.py @@ -510,13 +510,13 @@ TYPE_SENSOR, None, "mdi:ruler", S_IMPERIAL, STATE_CLASS_MEASUREMENT), TYPE_LEAK_CH1: ("Leak Detection 1", LEAK_DETECTED, TYPE_BINARY_SENSOR, - DEVICE_CLASS_MOISTURE, "mdi:leak", 0, 0), + DEVICE_CLASS_MOISTURE, "mdi:leak", 0, None), TYPE_LEAK_CH2: ("Leak Detection 2", LEAK_DETECTED, TYPE_BINARY_SENSOR, - DEVICE_CLASS_MOISTURE, "mdi:leak", 0, 0), + DEVICE_CLASS_MOISTURE, "mdi:leak", 0, None), TYPE_LEAK_CH3: ("Leak Detection 3", LEAK_DETECTED, TYPE_BINARY_SENSOR, - DEVICE_CLASS_MOISTURE, "mdi:leak", 0, 0), + DEVICE_CLASS_MOISTURE, "mdi:leak", 0, None), TYPE_LEAK_CH4: ("Leak Detection 4", LEAK_DETECTED, TYPE_BINARY_SENSOR, - DEVICE_CLASS_MOISTURE, "mdi:leak", 0, 0), + DEVICE_CLASS_MOISTURE, "mdi:leak", 0, None), TYPE_CO2_PM25: ("WH45 PM2.5", CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, TYPE_SENSOR, None, "mdi:eye", 0, STATE_CLASS_MEASUREMENT), TYPE_CO2_PM25_AVG_24H: ("WH45 PM2.5 24h average", @@ -545,9 +545,9 @@ DEVICE_CLASS_BATTERY, "mdi:battery", 0, STATE_CLASS_MEASUREMENT), TYPE_WH25BATT: ("WH25 Battery", "BATT", TYPE_BINARY_SENSOR, - DEVICE_CLASS_BATTERY, "mdi:battery", 0, 0), + DEVICE_CLASS_BATTERY, "mdi:battery", 0, None), TYPE_WH26BATT: ("WH26 Battery", "BATT", TYPE_BINARY_SENSOR, - DEVICE_CLASS_BATTERY, "mdi:battery", 0, 0), + DEVICE_CLASS_BATTERY, "mdi:battery", 0, None), TYPE_WH40BATT: ("WH40 Battery", ELECTRIC_POTENTIAL_VOLT, TYPE_SENSOR, DEVICE_CLASS_VOLTAGE, "mdi:battery", 0, STATE_CLASS_MEASUREMENT), @@ -555,7 +555,7 @@ DEVICE_CLASS_BATTERY, "mdi:battery", 0, STATE_CLASS_MEASUREMENT), TYPE_WH65BATT: ("WH65 Battery", "BATT", TYPE_BINARY_SENSOR, - DEVICE_CLASS_BATTERY, "mdi:battery", 0, 0), + DEVICE_CLASS_BATTERY, "mdi:battery", 0, None), TYPE_WH68BATT: ("WH68 Battery", ELECTRIC_POTENTIAL_VOLT, TYPE_SENSOR, DEVICE_CLASS_BATTERY, "mdi:battery", 0, STATE_CLASS_MEASUREMENT), @@ -587,21 +587,21 @@ TYPE_SENSOR, DEVICE_CLASS_VOLTAGE, "mdi:battery", 0, STATE_CLASS_MEASUREMENT), TYPE_BATTERY1: ("Battery 1", "BATT", TYPE_BINARY_SENSOR, - DEVICE_CLASS_BATTERY, "mdi:battery", 0, 0), + DEVICE_CLASS_BATTERY, "mdi:battery", 0, None), TYPE_BATTERY2: ("Battery 2", "BATT", TYPE_BINARY_SENSOR, - DEVICE_CLASS_BATTERY, "mdi:battery", 0, 0), + DEVICE_CLASS_BATTERY, "mdi:battery", 0, None), TYPE_BATTERY3: ("Battery 3", "BATT", TYPE_BINARY_SENSOR, - DEVICE_CLASS_BATTERY, "mdi:battery", 0, 0), + DEVICE_CLASS_BATTERY, "mdi:battery", 0, None), TYPE_BATTERY4: ("Battery 4", "BATT", TYPE_BINARY_SENSOR, - DEVICE_CLASS_BATTERY, "mdi:battery", 0, 0), + DEVICE_CLASS_BATTERY, "mdi:battery", 0, None), TYPE_BATTERY5: ("Battery 5", "BATT", TYPE_BINARY_SENSOR, - DEVICE_CLASS_BATTERY, "mdi:battery", 0, 0), + DEVICE_CLASS_BATTERY, "mdi:battery", 0, None), TYPE_BATTERY6: ("Battery 6", "BATT", TYPE_BINARY_SENSOR, - DEVICE_CLASS_BATTERY, "mdi:battery", 0, 0), + DEVICE_CLASS_BATTERY, "mdi:battery", 0, None), TYPE_BATTERY7: ("Battery 7", "BATT", TYPE_BINARY_SENSOR, - DEVICE_CLASS_BATTERY, "mdi:battery", 0, 0), + DEVICE_CLASS_BATTERY, "mdi:battery", 0, None), TYPE_BATTERY8: ("Battery 8", "BATT", TYPE_BINARY_SENSOR, - DEVICE_CLASS_BATTERY, "mdi:battery", 0, 0), + DEVICE_CLASS_BATTERY, "mdi:battery", 0, None), TYPE_PM25BATT1: ("PM2.5 1 Battery", PERCENTAGE, TYPE_SENSOR, DEVICE_CLASS_BATTERY, "mdi:battery", 0, STATE_CLASS_MEASUREMENT),