async_tariff_change tracks state change - state machine will not pass a None

pull/66490/head
Diogo Gomes 2022-02-14 21:50:29 +00:00
parent 1a7fe02113
commit 24fc04a964
1 changed files with 1 additions and 3 deletions

View File

@ -238,9 +238,7 @@ class UtilityMeterSensor(RestoreEntity, SensorEntity):
@callback
def async_tariff_change(self, event):
"""Handle tariff changes."""
if (new_state := event.data.get("new_state")) is None:
return
new_state = event.data.get("new_state")
self._change_status(new_state.state)
def _change_status(self, tariff):