Skip to content

Commit

Permalink
2022.5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
dgomes committed May 9, 2022
1 parent 711be6d commit 65149a4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions custom_components/erse/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
TariffCost(hass, config_entry.entry_id, tariff, meter_entity)
)

# TODO filter out to create a FixedCost of the monthly utility_meter entity
entities.append(FixedCost(hass, config_entry.entry_id, meter_entity))

async_add_entities(entities)
Expand All @@ -86,8 +87,8 @@ def __init__(self, hass, entry_id, tariff, meter_entity):

self._attr_device_class = DEVICE_CLASS_MONETARY
self._attr_state_class = STATE_CLASS_TOTAL_INCREASING
self._attr_unit_of_measurement = (
CURRENCY_EURO # TODO _attr_native_unit_of_measurement
self._attr_native_unit_of_measurement = (
CURRENCY_EURO
)

self._attr_name = f"{meter_entity} cost"
Expand Down Expand Up @@ -176,8 +177,8 @@ def __init__(self, hass, entry_id, any_meter) -> None:

self._attr_device_class = DEVICE_CLASS_MONETARY
self._attr_state_class = STATE_CLASS_TOTAL_INCREASING
self._attr_unit_of_measurement = (
CURRENCY_EURO # TODO _attr_native_unit_of_measurement
self._attr_native_unit_of_measurement = (
CURRENCY_EURO
)

self._attr_name = f"{self.operator} cost"
Expand Down

0 comments on commit 65149a4

Please sign in to comment.