Skip to content

Commit

Permalink
Update to use enums for constants for units and device class
Browse files Browse the repository at this point in the history
  • Loading branch information
hif2k1 authored Jan 16, 2023
1 parent 8928d99 commit 1b78776
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions custom_components/battery_sim/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1b78776

Please sign in to comment.