From fa833f65085ff72e8191620ae2fc2a378205b6f2 Mon Sep 17 00:00:00 2001 From: plata Date: Sun, 15 Nov 2026 22:07:51 +0100 Subject: [PATCH] ViCare: use temperature delta (K) for heating curve shift and dhw hysteresis (#191179) --- homeassistant/components/vicare/number.py | 8 ++++---- .../components/vicare/snapshots/test_number.ambr | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/vicare/number.py b/homeassistant/components/vicare/number.py index a6d78ff83614..d8fe4c4154c4 100644 --- a/homeassistant/components/vicare/number.py +++ b/homeassistant/components/vicare/number.py @@ -78,7 +78,7 @@ DEVICE_ENTITY_DESCRIPTIONS: tuple[ViCareNumberEntityDescription, ...] = ( key="dhw_hysteresis_switch_on", translation_key="dhw_hysteresis_switch_on", entity_category=EntityCategory.CONFIG, - device_class=NumberDeviceClass.TEMPERATURE, + device_class=NumberDeviceClass.TEMPERATURE_DELTA, native_unit_of_measurement=UnitOfTemperature.KELVIN, mode=NumberMode.BOX, value_getter=lambda api: api.getDomesticHotWaterHysteresisSwitchOn(), @@ -93,7 +93,7 @@ DEVICE_ENTITY_DESCRIPTIONS: tuple[ViCareNumberEntityDescription, ...] = ( key="dhw_hysteresis_switch_off", translation_key="dhw_hysteresis_switch_off", entity_category=EntityCategory.CONFIG, - device_class=NumberDeviceClass.TEMPERATURE, + device_class=NumberDeviceClass.TEMPERATURE_DELTA, native_unit_of_measurement=UnitOfTemperature.KELVIN, mode=NumberMode.BOX, value_getter=lambda api: api.getDomesticHotWaterHysteresisSwitchOff(), @@ -114,8 +114,8 @@ CIRCUIT_ENTITY_DESCRIPTIONS: tuple[ViCareNumberEntityDescription, ...] = ( key="heating curve shift", translation_key="heating_curve_shift", entity_category=EntityCategory.CONFIG, - device_class=NumberDeviceClass.TEMPERATURE, - native_unit_of_measurement=UnitOfTemperature.CELSIUS, + device_class=NumberDeviceClass.TEMPERATURE_DELTA, + native_unit_of_measurement=UnitOfTemperature.KELVIN, mode=NumberMode.BOX, value_getter=lambda api: api.getHeatingCurveShift(), value_setter=lambda api, shift: api.setHeatingCurve( diff --git a/tests/components/vicare/snapshots/test_number.ambr b/tests/components/vicare/snapshots/test_number.ambr index 7c10df27c2fe..d9d338a63e4c 100644 --- a/tests/components/vicare/snapshots/test_number.ambr +++ b/tests/components/vicare/snapshots/test_number.ambr @@ -212,7 +212,7 @@ 'object_id_base': 'Heating curve shift', 'options': dict({ }), - 'original_device_class': , + 'original_device_class': , 'original_icon': None, 'original_name': 'Heating curve shift', 'platform': 'vicare', @@ -221,19 +221,19 @@ 'supported_features': 0, 'translation_key': 'heating_curve_shift', 'unique_id': 'gateway0_deviceSerialVitodens300W-heating curve shift-0', - 'unit_of_measurement': , + 'unit_of_measurement': , }) # --- # name: test_all_entities[number.model0_heating_curve_shift-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - : 'temperature', + : 'temperature_delta', : 'model0 Heating curve shift', : 40, : -13, : , : 1, - : , + : , }), 'context': , 'entity_id': 'number.model0_heating_curve_shift', @@ -273,7 +273,7 @@ 'object_id_base': 'Heating curve shift', 'options': dict({ }), - 'original_device_class': , + 'original_device_class': , 'original_icon': None, 'original_name': 'Heating curve shift', 'platform': 'vicare', @@ -282,19 +282,19 @@ 'supported_features': 0, 'translation_key': 'heating_curve_shift', 'unique_id': 'gateway0_deviceSerialVitodens300W-heating curve shift-1', - 'unit_of_measurement': , + 'unit_of_measurement': , }) # --- # name: test_all_entities[number.model0_heating_curve_shift_2-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - : 'temperature', + : 'temperature_delta', : 'model0 Heating curve shift', : 40, : -13, : , : 1, - : , + : , }), 'context': , 'entity_id': 'number.model0_heating_curve_shift_2',