diff --git a/custom_components/versatile_thermostat/climate.py b/custom_components/versatile_thermostat/climate.py index 404b54fc..d1a08b1d 100644 --- a/custom_components/versatile_thermostat/climate.py +++ b/custom_components/versatile_thermostat/climate.py @@ -810,7 +810,9 @@ async def _async_max_power_changed(self, event): _LOGGER.debug(event) new_state = event.data.get("new_state") old_state = event.data.get("old_state") - if new_state is None or new_state.state == old_state.state: + if new_state is None or ( + old_state is not None and new_state.state == old_state.state + ): return try: