From 1b787763cecdc4b3dd09096bcca6364cb6acca22 Mon Sep 17 00:00:00 2001 From: hif2k1 Date: Mon, 16 Jan 2023 21:08:34 +0000 Subject: [PATCH] Update to use enums for constants for units and device class --- custom_components/battery_sim/config_flow.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/custom_components/battery_sim/config_flow.py b/custom_components/battery_sim/config_flow.py index 273775e..4131a93 100644 --- a/custom_components/battery_sim/config_flow.py +++ b/custom_components/battery_sim/config_flow.py @@ -88,11 +88,7 @@ async def async_step_connectsensors(self, user_input = None): energy_entities = [] for entity_id in entities: entity = self.hass.states.get(entity_id) -<<<<<<< Updated upstream - if entity.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfEnergy.KILO_WATT_HOUR or entity.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfEnergy.WATT_HOUR: -======= - if entity.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfEnergy.KILO_WATT_HOUR or entity.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == ENERGY_WATT_HOUR: ->>>>>>> Stashed changes + if entity.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfEnergy.KILO_WATT_HOUR or entity.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfEnergy.WATT_HOUR: energy_entities.append(entity_id) return self.async_show_form( step_id="connectsensors",