From 46326a47de5f00faa7449d9913b64f4c76c530ba Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 10 Dec 2021 09:06:23 +0100 Subject: [PATCH] Use new SensorDeviceClass enum in ebusd (#61374) Co-authored-by: epenet --- homeassistant/components/ebusd/const.py | 58 +++++++++++++++---------- 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/homeassistant/components/ebusd/const.py b/homeassistant/components/ebusd/const.py index 3d4ab508ca2..ac5ca313f2f 100644 --- a/homeassistant/components/ebusd/const.py +++ b/homeassistant/components/ebusd/const.py @@ -1,6 +1,6 @@ """Constants for ebus component.""" +from homeassistant.components.sensor import SensorDeviceClass from homeassistant.const import ( - DEVICE_CLASS_TEMPERATURE, ENERGY_KILO_WATT_HOUR, PERCENTAGE, PRESSURE_BAR, @@ -20,21 +20,21 @@ SENSOR_TYPES = { TEMP_CELSIUS, None, 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "MaxFlowTemperatureDesired": [ "Hc1MaxFlowTempDesired", TEMP_CELSIUS, None, 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "MinFlowTemperatureDesired": [ "Hc1MinFlowTempDesired", TEMP_CELSIUS, None, 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "PumpStatus": ["Hc1PumpStatus", None, "mdi:toggle-switch", 2, None], "HCSummerTemperatureLimit": [ @@ -42,28 +42,28 @@ SENSOR_TYPES = { TEMP_CELSIUS, "mdi:weather-sunny", 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "HolidayTemperature": [ "HolidayTemp", TEMP_CELSIUS, None, 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "HWTemperatureDesired": [ "HwcTempDesired", TEMP_CELSIUS, None, 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "HWActualTemperature": [ "HwcStorageTemp", TEMP_CELSIUS, None, 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "HWTimerMonday": ["hwcTimer.Monday", None, "mdi:timer-outline", 1, None], "HWTimerTuesday": ["hwcTimer.Tuesday", None, "mdi:timer-outline", 1, None], @@ -80,35 +80,35 @@ SENSOR_TYPES = { TEMP_CELSIUS, "mdi:weather-night", 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "Zone1DayTemperature": [ "z1DayTemp", TEMP_CELSIUS, "mdi:weather-sunny", 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "Zone1HolidayTemperature": [ "z1HolidayTemp", TEMP_CELSIUS, None, 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "Zone1RoomTemperature": [ "z1RoomTemp", TEMP_CELSIUS, None, 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "Zone1ActualRoomTemperatureDesired": [ "z1ActualRoomTempDesired", TEMP_CELSIUS, None, 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "Zone1TimerMonday": ["z1Timer.Monday", None, "mdi:timer-outline", 1, None], "Zone1TimerTuesday": ["z1Timer.Tuesday", None, "mdi:timer-outline", 1, None], @@ -129,7 +129,7 @@ SENSOR_TYPES = { TEMP_CELSIUS, "mdi:weather-snowy", 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "PowerEnergyConsumptionLastMonth": [ "PrEnergySumHcLastMonth", @@ -147,8 +147,20 @@ SENSOR_TYPES = { ], }, "ehp": { - "HWTemperature": ["HwcTemp", TEMP_CELSIUS, None, 4, DEVICE_CLASS_TEMPERATURE], - "OutsideTemp": ["OutsideTemp", TEMP_CELSIUS, None, 4, DEVICE_CLASS_TEMPERATURE], + "HWTemperature": [ + "HwcTemp", + TEMP_CELSIUS, + None, + 4, + SensorDeviceClass.TEMPERATURE, + ], + "OutsideTemp": [ + "OutsideTemp", + TEMP_CELSIUS, + None, + 4, + SensorDeviceClass.TEMPERATURE, + ], }, "bai": { "HotWaterTemperature": [ @@ -156,28 +168,28 @@ SENSOR_TYPES = { TEMP_CELSIUS, None, 4, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "StorageTemperature": [ "StorageTemp", TEMP_CELSIUS, None, 4, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "DesiredStorageTemperature": [ "StorageTempDesired", TEMP_CELSIUS, None, 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "OutdoorsTemperature": [ "OutdoorstempSensor", TEMP_CELSIUS, None, 4, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "WaterPreasure": ["WaterPressure", PRESSURE_BAR, "mdi:pipe", 4, None], "AverageIgnitionTime": [ @@ -206,7 +218,7 @@ SENSOR_TYPES = { TEMP_CELSIUS, None, 4, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "CentralHeatingPump": ["WP", None, "mdi:toggle-switch", 2, None], "HeatingSwitch": ["HeatingSwitch", None, "mdi:toggle-switch", 2, None], @@ -215,14 +227,14 @@ SENSOR_TYPES = { TEMP_CELSIUS, None, 0, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "FlowTemperature": [ "FlowTemp", TEMP_CELSIUS, None, 4, - DEVICE_CLASS_TEMPERATURE, + SensorDeviceClass.TEMPERATURE, ], "Flame": ["Flame", None, "mdi:toggle-switch", 2, None], "PowerEnergyConsumptionHeatingCircuit": [