Skip to content

Commit

Permalink
simplify call track event
Browse files Browse the repository at this point in the history
  • Loading branch information
jugla committed Oct 18, 2021
1 parent a146082 commit a3a9fb2
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions custom_components/battery_consumption/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,13 @@ async def async_added_to_hass(self):
)

# listen to source ID
self.async_on_remove(
async_track_state_change_event(
self.hass,
[self._source_entity_id],
self._async_battery_consumption_sensor_state_listener,
)
async_track_state_change_event(
self.hass,
[self._source_entity_id],
self._async_battery_consumption_sensor_state_listener,
)


@property
def unique_id(self):
"""Return the unique id of this sensor."""
Expand Down

0 comments on commit a3a9fb2

Please sign in to comment.