async_tariff_change tracks state change - state machine will not pass a None
parent
1a7fe02113
commit
24fc04a964
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue