[#425] - Boiler management entities are generated independently of this option selection (#426)

Co-authored-by: Jean-Marc Collin <jean-marc.collin-extern@renault.com>
This commit is contained in:
Jean-Marc Collin
2024-03-25 08:00:08 +01:00
committed by GitHub
parent 6a97622226
commit 162efb4709
3 changed files with 17 additions and 9 deletions

View File

@@ -51,6 +51,7 @@ from .const import (
CONF_USE_PRESETS_CENTRAL_CONFIG,
CONF_USE_PRESENCE_CENTRAL_CONFIG,
CONF_USE_PRESENCE_FEATURE,
CONF_USE_CENTRAL_BOILER_FEATURE,
overrides,
)
@@ -153,9 +154,10 @@ async def async_setup_entry(
# For central config only
else:
entities.append(
ActivateBoilerThresholdNumber(hass, unique_id, name, entry.data)
)
if entry.data.get(CONF_USE_CENTRAL_BOILER_FEATURE):
entities.append(
ActivateBoilerThresholdNumber(hass, unique_id, name, entry.data)
)
for preset in CONF_PRESETS_WITH_AC_VALUES:
_LOGGER.debug(
"%s - configuring Number central, AC, non AWAY for preset %s",
@@ -178,7 +180,8 @@ async def async_setup_entry(
)
)
async_add_entities(entities, True)
if len(entities) > 0:
async_add_entities(entities, True)
class ActivateBoilerThresholdNumber(