Validation tests ok
This commit is contained in:
@@ -772,8 +772,6 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
|
||||
self._hvac_mode or HVACMode.OFF,
|
||||
)
|
||||
|
||||
self.hass.create_task(self._check_initial_state())
|
||||
|
||||
self.reset_last_change_time()
|
||||
|
||||
await self.get_my_previous_state()
|
||||
@@ -2696,3 +2694,6 @@ class BaseThermostat(ClimateEntity, RestoreEntity):
|
||||
# Re-applicate the last preset if any to take change into account
|
||||
if self._attr_preset_mode:
|
||||
await self._async_set_preset_mode_internal(self._attr_preset_mode, True)
|
||||
|
||||
self.hass.create_task(self._check_initial_state())
|
||||
|
||||
|
||||
@@ -45,9 +45,6 @@ from .thermostat_valve import ThermostatOverValve
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
# _LOGGER.setLevel(logging.DEBUG)
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
entry: ConfigEntry,
|
||||
|
||||
@@ -318,7 +318,7 @@ class CentralConfigTemperatureNumber(
|
||||
pass
|
||||
|
||||
@overrides
|
||||
def set_native_value(self, value: float) -> None:
|
||||
async def async_set_native_value(self, value: float) -> None:
|
||||
"""The value have change from the Number Entity in UI"""
|
||||
float_value = float(value)
|
||||
old_value = float(self._attr_native_value)
|
||||
@@ -327,6 +327,9 @@ class CentralConfigTemperatureNumber(
|
||||
|
||||
self._attr_value = self._attr_native_value = float_value
|
||||
|
||||
# persist the value
|
||||
self.async_write_ha_state()
|
||||
|
||||
# We have to reload all VTherm for which uses the central configuration
|
||||
api: VersatileThermostatAPI = VersatileThermostatAPI.get_vtherm_api(self.hass)
|
||||
# Update the VTherms which have temperature in central config
|
||||
@@ -426,7 +429,7 @@ class TemperatureNumber( # pylint: disable=abstract-method
|
||||
return
|
||||
|
||||
@overrides
|
||||
def set_native_value(self, value: float) -> None:
|
||||
async def async_set_native_value(self, value: float) -> None:
|
||||
"""Change the value"""
|
||||
|
||||
if self.my_climate is None:
|
||||
@@ -442,6 +445,7 @@ class TemperatureNumber( # pylint: disable=abstract-method
|
||||
return
|
||||
|
||||
self._attr_value = self._attr_native_value = float_value
|
||||
self.async_write_ha_state()
|
||||
|
||||
# Update the VTherm temp
|
||||
self.hass.create_task(
|
||||
|
||||
@@ -869,7 +869,7 @@ async def test_change_central_config_temperature(
|
||||
assert temp_entity
|
||||
assert temp_entity.value == 19.1
|
||||
|
||||
temp_entity.set_native_value(20.3)
|
||||
await temp_entity.async_set_native_value(20.3)
|
||||
assert temp_entity
|
||||
assert temp_entity.value == 20.3
|
||||
# Wait for async job to complete
|
||||
@@ -985,7 +985,7 @@ async def test_change_vtherm_temperature(
|
||||
assert temp_entity
|
||||
assert temp_entity.value == 19.1
|
||||
|
||||
temp_entity.set_native_value(20.3)
|
||||
await temp_entity.async_set_native_value(20.3)
|
||||
assert temp_entity
|
||||
assert temp_entity.value == 20.3
|
||||
# Wait for async job to complete
|
||||
@@ -1106,7 +1106,7 @@ async def test_change_vtherm_temperature_with_presence(
|
||||
assert temp_entity
|
||||
assert temp_entity.value == 30
|
||||
|
||||
temp_entity.set_native_value(20.3)
|
||||
await temp_entity.async_set_native_value(20.3)
|
||||
assert temp_entity
|
||||
assert temp_entity.value == 20.3
|
||||
# Wait for async job to complete
|
||||
@@ -1131,7 +1131,7 @@ async def test_change_vtherm_temperature_with_presence(
|
||||
assert temp_entity
|
||||
assert temp_entity.value == 30
|
||||
|
||||
temp_entity.set_native_value(20.3)
|
||||
await temp_entity.async_set_native_value(20.3)
|
||||
assert temp_entity
|
||||
assert temp_entity.value == 20.3
|
||||
# Wait for async job to complete
|
||||
|
||||
Reference in New Issue
Block a user