mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add hot water target temp number entity in ViCare integration (#123633)
* add DHW target temp number entity * Update number.py * Update strings.json * Update strings.json * update test snapshot * fix snapshot
This commit is contained in:
parent
19cbc1b258
commit
9e2360791d
@ -50,6 +50,18 @@ class ViCareNumberEntityDescription(NumberEntityDescription, ViCareRequiredKeysM
|
|||||||
|
|
||||||
|
|
||||||
DEVICE_ENTITY_DESCRIPTIONS: tuple[ViCareNumberEntityDescription, ...] = (
|
DEVICE_ENTITY_DESCRIPTIONS: tuple[ViCareNumberEntityDescription, ...] = (
|
||||||
|
ViCareNumberEntityDescription(
|
||||||
|
key="dhw_temperature",
|
||||||
|
translation_key="dhw_temperature",
|
||||||
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
device_class=NumberDeviceClass.TEMPERATURE,
|
||||||
|
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||||
|
value_getter=lambda api: api.getDomesticHotWaterConfiguredTemperature(),
|
||||||
|
value_setter=lambda api, value: api.setDomesticHotWaterTemperature(value),
|
||||||
|
min_value_getter=lambda api: api.getDomesticHotWaterMinTemperature(),
|
||||||
|
max_value_getter=lambda api: api.getDomesticHotWaterMaxTemperature(),
|
||||||
|
native_step=1,
|
||||||
|
),
|
||||||
ViCareNumberEntityDescription(
|
ViCareNumberEntityDescription(
|
||||||
key="dhw_secondary_temperature",
|
key="dhw_secondary_temperature",
|
||||||
translation_key="dhw_secondary_temperature",
|
translation_key="dhw_secondary_temperature",
|
||||||
|
@ -105,6 +105,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_temperature": {
|
||||||
|
"name": "DHW temperature"
|
||||||
|
},
|
||||||
"dhw_secondary_temperature": {
|
"dhw_secondary_temperature": {
|
||||||
"name": "DHW secondary temperature"
|
"name": "DHW secondary temperature"
|
||||||
}
|
}
|
||||||
|
@ -565,3 +565,60 @@
|
|||||||
'state': 'unavailable',
|
'state': 'unavailable',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_all_entities[number.model0_dhw_temperature-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'max': 100.0,
|
||||||
|
'min': 0.0,
|
||||||
|
'mode': <NumberMode.AUTO: 'auto'>,
|
||||||
|
'step': 1,
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'number',
|
||||||
|
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||||
|
'entity_id': 'number.model0_dhw_temperature',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'DHW temperature',
|
||||||
|
'platform': 'vicare',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'dhw_temperature',
|
||||||
|
'unique_id': 'gateway0-dhw_temperature',
|
||||||
|
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_all_entities[number.model0_dhw_temperature-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'temperature',
|
||||||
|
'friendly_name': 'model0 DHW temperature',
|
||||||
|
'max': 100.0,
|
||||||
|
'min': 0.0,
|
||||||
|
'mode': <NumberMode.AUTO: 'auto'>,
|
||||||
|
'step': 1,
|
||||||
|
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'number.model0_dhw_temperature',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'unavailable',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
Loading…
x
Reference in New Issue
Block a user