Issue #518 - Fix ThermostatOverClimate object has no attribute __attr_preset_modes

This commit is contained in:
Jean-Marc Collin
2024-10-06 08:58:58 +00:00
parent 4c1fc396fb
commit 6e42904ddf

View File

@@ -13,7 +13,6 @@ from homeassistant.util import dt as dt_util
from homeassistant.core import ( from homeassistant.core import (
HomeAssistant, HomeAssistant,
callback, callback,
CoreState,
Event, Event,
State, State,
) )
@@ -57,7 +56,6 @@ from homeassistant.const import (
STATE_UNKNOWN, STATE_UNKNOWN,
STATE_OFF, STATE_OFF,
STATE_ON, STATE_ON,
EVENT_HOMEASSISTANT_START,
STATE_HOME, STATE_HOME,
STATE_NOT_HOME, STATE_NOT_HOME,
) )
@@ -299,7 +297,7 @@ class BaseThermostat(ClimateEntity, RestoreEntity, Generic[T]):
self._presets: dict[str, Any] = {} # presets self._presets: dict[str, Any] = {} # presets
self._presets_away: dict[str, Any] = {} # presets_away self._presets_away: dict[str, Any] = {} # presets_away
self._attr_preset_modes: list[str] | None self._attr_preset_modes: list[str] = []
self._use_central_config_temperature = False self._use_central_config_temperature = False
@@ -2183,7 +2181,7 @@ class BaseThermostat(ClimateEntity, RestoreEntity, Generic[T]):
new_central_mode, new_central_mode,
) )
first_init = self._last_central_mode == None first_init = self._last_central_mode is None
self._last_central_mode = new_central_mode self._last_central_mode = new_central_mode