diff --git a/homeassistant/components/utility_meter/sensor.py b/homeassistant/components/utility_meter/sensor.py index b7f7a359d97..54436c41ffe 100644 --- a/homeassistant/components/utility_meter/sensor.py +++ b/homeassistant/components/utility_meter/sensor.py @@ -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):