Add secondary temperature sensor for DHW in ViCare (#106612)
* add temp2 sensor * Update strings.jsonpull/114686/head^2
parent
f62a3a7176
commit
9bae6d694d
homeassistant/components/vicare
|
@ -49,6 +49,23 @@ class ViCareNumberEntityDescription(NumberEntityDescription, ViCareRequiredKeysM
|
||||||
stepping_getter: Callable[[PyViCareDevice], float | None] | None = None
|
stepping_getter: Callable[[PyViCareDevice], float | None] | None = None
|
||||||
|
|
||||||
|
|
||||||
|
DEVICE_ENTITY_DESCRIPTIONS: tuple[ViCareNumberEntityDescription, ...] = (
|
||||||
|
ViCareNumberEntityDescription(
|
||||||
|
key="dhw_secondary_temperature",
|
||||||
|
translation_key="dhw_secondary_temperature",
|
||||||
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
device_class=NumberDeviceClass.TEMPERATURE,
|
||||||
|
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||||
|
value_getter=lambda api: api.getDomesticHotWaterConfiguredTemperature2(),
|
||||||
|
value_setter=lambda api, value: api.setDomesticHotWaterTemperature2(value),
|
||||||
|
# no getters for min, max, stepping exposed yet, using static values
|
||||||
|
native_min_value=10,
|
||||||
|
native_max_value=60,
|
||||||
|
native_step=1,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
CIRCUIT_ENTITY_DESCRIPTIONS: tuple[ViCareNumberEntityDescription, ...] = (
|
CIRCUIT_ENTITY_DESCRIPTIONS: tuple[ViCareNumberEntityDescription, ...] = (
|
||||||
ViCareNumberEntityDescription(
|
ViCareNumberEntityDescription(
|
||||||
key="heating curve shift",
|
key="heating curve shift",
|
||||||
|
@ -216,18 +233,32 @@ def _build_entities(
|
||||||
) -> list[ViCareNumber]:
|
) -> list[ViCareNumber]:
|
||||||
"""Create ViCare number entities for a device."""
|
"""Create ViCare number entities for a device."""
|
||||||
|
|
||||||
return [
|
entities: list[ViCareNumber] = [
|
||||||
ViCareNumber(
|
ViCareNumber(
|
||||||
circuit,
|
device.api,
|
||||||
device.config,
|
device.config,
|
||||||
description,
|
description,
|
||||||
)
|
)
|
||||||
for device in device_list
|
for device in device_list
|
||||||
for circuit in get_circuits(device.api)
|
for description in DEVICE_ENTITY_DESCRIPTIONS
|
||||||
for description in CIRCUIT_ENTITY_DESCRIPTIONS
|
if is_supported(description.key, description, device.api)
|
||||||
if is_supported(description.key, description, circuit)
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
entities.extend(
|
||||||
|
[
|
||||||
|
ViCareNumber(
|
||||||
|
circuit,
|
||||||
|
device.config,
|
||||||
|
description,
|
||||||
|
)
|
||||||
|
for device in device_list
|
||||||
|
for circuit in get_circuits(device.api)
|
||||||
|
for description in CIRCUIT_ENTITY_DESCRIPTIONS
|
||||||
|
if is_supported(description.key, description, circuit)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
return entities
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
|
|
|
@ -89,6 +89,9 @@
|
||||||
},
|
},
|
||||||
"comfort_heating_temperature": {
|
"comfort_heating_temperature": {
|
||||||
"name": "[%key:component::vicare::entity::number::comfort_temperature::name%]"
|
"name": "[%key:component::vicare::entity::number::comfort_temperature::name%]"
|
||||||
|
},
|
||||||
|
"dhw_secondary_temperature": {
|
||||||
|
"name": "DHW secondary temperature"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"sensor": {
|
"sensor": {
|
||||||
|
|
Loading…
Reference in New Issue