Python12 env rebuild

This commit is contained in:
Jean-Marc Collin
2024-02-25 17:18:14 +00:00
parent f7da58d841
commit 4478d65ad4
13 changed files with 81 additions and 42 deletions

View File

@@ -40,13 +40,13 @@ HIDDEN_PRESETS = [PRESET_POWER, PRESET_SECURITY]
DOMAIN = "versatile_thermostat"
# The order is important.
# NUMBER should be after CLIMATE,
PLATFORMS: list[Platform] = [
Platform.SELECT,
Platform.CLIMATE,
Platform.SENSOR,
Platform.BINARY_SENSOR,
# Number should be after CLIMATE
Platform.NUMBER,
Platform.BINARY_SENSOR,
]
CONF_HEATER = "heater_entity_id"

View File

@@ -1,4 +1,5 @@
""" The API of Versatile Thermostat"""
import logging
from homeassistant.core import HomeAssistant
from homeassistant.config_entries import ConfigEntry
@@ -106,10 +107,21 @@ class VersatileThermostatAPI(dict):
):
"""register the two number entities needed for boiler activation"""
self._threshold_number_entity = threshold_number_entity
# If sensor and threshold number are initialized, reload the listener
if self._nb_active_number_entity and self._central_boiler_entity:
self._hass.async_add_job(self.reload_central_boiler_binary_listener)
def register_nb_device_active_boiler(self, nb_active_number_entity):
"""register the two number entities needed for boiler activation"""
self._nb_active_number_entity = nb_active_number_entity
if self._threshold_number_entity and self._central_boiler_entity:
self._hass.async_add_job(self.reload_central_boiler_binary_listener)
async def reload_central_boiler_binary_listener(self):
"""Reloads the BinarySensor entity which listen to the number of
active devices and the thresholds entities"""
if self._central_boiler_entity:
await self._central_boiler_entity.listen_nb_active_vtherm_entity()
async def reload_central_boiler_entities_list(self):
"""Reload the central boiler list of entities if a central boiler is used"""