diff --git a/homeassistant/components/vicare/sensor.py b/homeassistant/components/vicare/sensor.py index 864439c746c4..7825db7043ba 100644 --- a/homeassistant/components/vicare/sensor.py +++ b/homeassistant/components/vicare/sensor.py @@ -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, ...] = ( diff --git a/homeassistant/components/vicare/strings.json b/homeassistant/components/vicare/strings.json index 260b51f56f3f..99c78e262a65 100644 --- a/homeassistant/components/vicare/strings.json +++ b/homeassistant/components/vicare/strings.json @@ -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" }, diff --git a/tests/components/vicare/conftest.py b/tests/components/vicare/conftest.py index 8e10d2f1a259..2608e4bbf64c 100644 --- a/tests/components/vicare/conftest.py +++ b/tests/components/vicare/conftest.py @@ -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", ) ) diff --git a/tests/components/vicare/fixtures/VitoValor.json b/tests/components/vicare/fixtures/VitoValor.json new file mode 100644 index 000000000000..07bed9faea50 --- /dev/null +++ b/tests/components/vicare/fixtures/VitoValor.json @@ -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" + } + ] +} diff --git a/tests/components/vicare/snapshots/test_sensor.ambr b/tests/components/vicare/snapshots/test_sensor.ambr index 22cba704dcfa..6c21511a201a 100644 --- a/tests/components/vicare/snapshots/test_sensor.ambr +++ b/tests/components/vicare/snapshots/test_sensor.ambr @@ -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': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.vitovalor_hydraulic_separator_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + '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': , + }) +# --- +# 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': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.vitovalor_hydraulic_separator_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '22.3', + }) +# --- # name: test_all_entities[type:boiler-vicare/Vitodens300W.json][sensor.model0_boiler_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ diff --git a/tests/components/vicare/test_sensor.py b/tests/components/vicare/test_sensor.py index be7418291a8a..ce2862120939 100644 --- a/tests/components/vicare/test_sensor.py +++ b/tests/components/vicare/test_sensor.py @@ -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(