Add heat pump heating rod sensors in ViCare integration ()

* add heating rod sensors

* add labels

* update snapshot
pull/136547/head
Christopher Fenner 2025-01-25 21:42:49 +01:00 committed by GitHub
parent 34e8595d19
commit 5e6f624938
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 120 additions and 0 deletions
homeassistant/components/vicare
tests/components/vicare/snapshots

View File

@ -847,6 +847,21 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
value_getter=lambda api: api.getSupplyPressure(),
unit_getter=lambda api: api.getSupplyPressureUnit(),
),
ViCareSensorEntityDescription(
key="heating_rod_starts",
translation_key="heating_rod_starts",
value_getter=lambda api: api.getHeatingRodStarts(),
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.TOTAL_INCREASING,
),
ViCareSensorEntityDescription(
key="heating_rod_hours",
translation_key="heating_rod_hours",
native_unit_of_measurement=UnitOfTime.HOURS,
value_getter=lambda api: api.getHeatingRodHours(),
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.TOTAL_INCREASING,
),
)
CIRCUIT_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (

View File

@ -458,6 +458,12 @@
},
"supply_pressure": {
"name": "Supply pressure"
},
"heating_rod_starts": {
"name": "Heating rod starts"
},
"heating_rod_hours": {
"name": "Heating rod hours"
}
},
"water_heater": {

View File

@ -1858,6 +1858,105 @@
'state': '16.4',
})
# ---
# name: test_all_entities[type:heatpump-vicare/Vitocal250A.json][sensor.model0_heating_rod_hours-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.model0_heating_rod_hours',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Heating rod hours',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'heating_rod_hours',
'unique_id': 'gateway0_deviceSerialVitocal250A-heating_rod_hours',
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_all_entities[type:heatpump-vicare/Vitocal250A.json][sensor.model0_heating_rod_hours-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model0 Heating rod hours',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.model0_heating_rod_hours',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '0',
})
# ---
# name: test_all_entities[type:heatpump-vicare/Vitocal250A.json][sensor.model0_heating_rod_starts-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.model0_heating_rod_starts',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Heating rod starts',
'platform': 'vicare',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'heating_rod_starts',
'unique_id': 'gateway0_deviceSerialVitocal250A-heating_rod_starts',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[type:heatpump-vicare/Vitocal250A.json][sensor.model0_heating_rod_starts-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'model0 Heating rod starts',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
}),
'context': <ANY>,
'entity_id': 'sensor.model0_heating_rod_starts',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '0',
})
# ---
# name: test_all_entities[type:heatpump-vicare/Vitocal250A.json][sensor.model0_outside_temperature-entry]
EntityRegistryEntrySnapshot({
'aliases': set({