Co-authored-by: Jean-Marc Collin <jean-marc.collin-extern@renault.com>
This commit is contained in:
@@ -39,6 +39,7 @@ from .const import (
|
|||||||
CONF_USE_WINDOW_FEATURE,
|
CONF_USE_WINDOW_FEATURE,
|
||||||
CONF_THERMOSTAT_TYPE,
|
CONF_THERMOSTAT_TYPE,
|
||||||
CONF_THERMOSTAT_CENTRAL_CONFIG,
|
CONF_THERMOSTAT_CENTRAL_CONFIG,
|
||||||
|
CONF_USE_CENTRAL_BOILER_FEATURE,
|
||||||
CONF_CENTRAL_BOILER_ACTIVATION_SRV,
|
CONF_CENTRAL_BOILER_ACTIVATION_SRV,
|
||||||
CONF_CENTRAL_BOILER_DEACTIVATION_SRV,
|
CONF_CENTRAL_BOILER_DEACTIVATION_SRV,
|
||||||
overrides,
|
overrides,
|
||||||
@@ -63,7 +64,10 @@ async def async_setup_entry(
|
|||||||
name = entry.data.get(CONF_NAME)
|
name = entry.data.get(CONF_NAME)
|
||||||
vt_type = entry.data.get(CONF_THERMOSTAT_TYPE)
|
vt_type = entry.data.get(CONF_THERMOSTAT_TYPE)
|
||||||
|
|
||||||
|
entities = None
|
||||||
|
|
||||||
if vt_type == CONF_THERMOSTAT_CENTRAL_CONFIG:
|
if vt_type == CONF_THERMOSTAT_CENTRAL_CONFIG:
|
||||||
|
if entry.data.get(CONF_USE_CENTRAL_BOILER_FEATURE):
|
||||||
entities = [
|
entities = [
|
||||||
CentralBoilerBinarySensor(hass, unique_id, name, entry.data),
|
CentralBoilerBinarySensor(hass, unique_id, name, entry.data),
|
||||||
]
|
]
|
||||||
@@ -81,6 +85,7 @@ async def async_setup_entry(
|
|||||||
if entry.data.get(CONF_USE_POWER_FEATURE):
|
if entry.data.get(CONF_USE_POWER_FEATURE):
|
||||||
entities.append(OverpoweringBinarySensor(hass, unique_id, name, entry.data))
|
entities.append(OverpoweringBinarySensor(hass, unique_id, name, entry.data))
|
||||||
|
|
||||||
|
if entities:
|
||||||
async_add_entities(entities, True)
|
async_add_entities(entities, True)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ from .const import (
|
|||||||
CONF_USE_PRESETS_CENTRAL_CONFIG,
|
CONF_USE_PRESETS_CENTRAL_CONFIG,
|
||||||
CONF_USE_PRESENCE_CENTRAL_CONFIG,
|
CONF_USE_PRESENCE_CENTRAL_CONFIG,
|
||||||
CONF_USE_PRESENCE_FEATURE,
|
CONF_USE_PRESENCE_FEATURE,
|
||||||
|
CONF_USE_CENTRAL_BOILER_FEATURE,
|
||||||
overrides,
|
overrides,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -153,6 +154,7 @@ async def async_setup_entry(
|
|||||||
|
|
||||||
# For central config only
|
# For central config only
|
||||||
else:
|
else:
|
||||||
|
if entry.data.get(CONF_USE_CENTRAL_BOILER_FEATURE):
|
||||||
entities.append(
|
entities.append(
|
||||||
ActivateBoilerThresholdNumber(hass, unique_id, name, entry.data)
|
ActivateBoilerThresholdNumber(hass, unique_id, name, entry.data)
|
||||||
)
|
)
|
||||||
@@ -178,6 +180,7 @@ async def async_setup_entry(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if len(entities) > 0:
|
||||||
async_add_entities(entities, True)
|
async_add_entities(entities, True)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ async def async_setup_entry(
|
|||||||
entities = [
|
entities = [
|
||||||
NbActiveDeviceForBoilerSensor(hass, unique_id, name, entry.data)
|
NbActiveDeviceForBoilerSensor(hass, unique_id, name, entry.data)
|
||||||
]
|
]
|
||||||
async_add_entities(entities, True)
|
|
||||||
else:
|
else:
|
||||||
entities = [
|
entities = [
|
||||||
LastTemperatureSensor(hass, unique_id, name, entry.data),
|
LastTemperatureSensor(hass, unique_id, name, entry.data),
|
||||||
@@ -108,6 +107,7 @@ async def async_setup_entry(
|
|||||||
RegulatedTemperatureSensor(hass, unique_id, name, entry.data)
|
RegulatedTemperatureSensor(hass, unique_id, name, entry.data)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if entities:
|
||||||
async_add_entities(entities, True)
|
async_add_entities(entities, True)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user