mirror of
https://github.com/home-assistant/core.git
synced 2026-04-25 21:56:08 +00:00
Add sensor for hydraulic separator temperature in ViCare integration (#153696)
This commit is contained in:
committed by
GitHub
parent
66cca981a9
commit
d9691c2a3b
@@ -952,6 +952,15 @@ GLOBAL_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
||||
value_getter=lambda api: api.getFuelNeed(),
|
||||
unit_getter=lambda api: api.getFuelUnit(),
|
||||
),
|
||||
ViCareSensorEntityDescription(
|
||||
key="hydraulic_separator_temperature",
|
||||
translation_key="hydraulic_separator_temperature",
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||
value_getter=lambda api: api.getHydraulicSeparatorTemperature(),
|
||||
),
|
||||
)
|
||||
|
||||
CIRCUIT_SENSORS: tuple[ViCareSensorEntityDescription, ...] = (
|
||||
|
||||
@@ -293,6 +293,9 @@
|
||||
"energy_summary_dhw_consumption_heating_lastsevendays": {
|
||||
"name": "DHW electricity consumption last seven days"
|
||||
},
|
||||
"hydraulic_separator_temperature": {
|
||||
"name": "Hydraulic separator temperature"
|
||||
},
|
||||
"power_consumption_today": {
|
||||
"name": "Electricity consumption today"
|
||||
},
|
||||
|
||||
@@ -39,7 +39,9 @@ class MockPyViCare:
|
||||
f"installation{idx}", f"gateway{idx}", f"device{idx}", fixture
|
||||
),
|
||||
f"deviceId{idx}",
|
||||
f"model{idx}",
|
||||
"Vitovalor"
|
||||
if fixture.data_file.endswith("VitoValor.json")
|
||||
else f"model{idx}",
|
||||
"online",
|
||||
)
|
||||
)
|
||||
|
||||
26
tests/components/vicare/fixtures/VitoValor.json
Normal file
26
tests/components/vicare/fixtures/VitoValor.json
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"apiVersion": 1,
|
||||
"commands": {},
|
||||
"deviceId": "0",
|
||||
"feature": "heating.sensors.temperature.hydraulicSeparator",
|
||||
"gatewayId": "################",
|
||||
"isEnabled": true,
|
||||
"isReady": true,
|
||||
"properties": {
|
||||
"status": {
|
||||
"type": "string",
|
||||
"value": "connected"
|
||||
},
|
||||
"value": {
|
||||
"type": "number",
|
||||
"unit": "celsius",
|
||||
"value": 22.3
|
||||
}
|
||||
},
|
||||
"timestamp": "2022-11-18T06:52:46.507Z",
|
||||
"uri": "https://api.viessmann-climatesolutions.com/iot/v1/equipment/installations/#######/gateways/################/devices/0/features/heating.sensors.temperature.hydraulicSeparator"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,60 @@
|
||||
# serializer version: 1
|
||||
# name: test_all_entities[None-vicare/VitoValor.json][sensor.vitovalor_hydraulic_separator_temperature-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
|
||||
'entity_id': 'sensor.vitovalor_hydraulic_separator_temperature',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
'sensor': dict({
|
||||
'suggested_display_precision': 1,
|
||||
}),
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.TEMPERATURE: 'temperature'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Hydraulic separator temperature',
|
||||
'platform': 'vicare',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'hydraulic_separator_temperature',
|
||||
'unique_id': 'gateway0_deviceId0-hydraulic_separator_temperature',
|
||||
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[None-vicare/VitoValor.json][sensor.vitovalor_hydraulic_separator_temperature-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'temperature',
|
||||
'friendly_name': 'Vitovalor Hydraulic separator temperature',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.vitovalor_hydraulic_separator_temperature',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '22.3',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[type:boiler-vicare/Vitodens300W.json][sensor.model0_boiler_temperature-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
||||
@@ -23,6 +23,7 @@ from tests.common import MockConfigEntry, snapshot_platform
|
||||
("type:heatpump", "vicare/Vitocal250A.json"),
|
||||
("type:ventilation", "vicare/ViAir300F.json"),
|
||||
("type:ess", "vicare/VitoChargeVX3.json"),
|
||||
(None, "vicare/VitoValor.json"),
|
||||
],
|
||||
)
|
||||
async def test_all_entities(
|
||||
|
||||
Reference in New Issue
Block a user