diff --git a/homeassistant/components/plugwise/number.py b/homeassistant/components/plugwise/number.py index 6fd3f7f92da..7e387abea02 100644 --- a/homeassistant/components/plugwise/number.py +++ b/homeassistant/components/plugwise/number.py @@ -60,6 +60,16 @@ NUMBER_TYPES = ( entity_category=EntityCategory.CONFIG, native_unit_of_measurement=UnitOfTemperature.CELSIUS, ), + PlugwiseNumberEntityDescription( + key="temperature_offset", + translation_key="temperature_offset", + command=lambda api, number, dev_id, value: api.set_temperature_offset( + number, dev_id, value + ), + device_class=NumberDeviceClass.TEMPERATURE, + entity_category=EntityCategory.CONFIG, + native_unit_of_measurement=UnitOfTemperature.CELSIUS, + ), ) diff --git a/homeassistant/components/plugwise/strings.json b/homeassistant/components/plugwise/strings.json index 5210f8a6dc0..2714d657267 100644 --- a/homeassistant/components/plugwise/strings.json +++ b/homeassistant/components/plugwise/strings.json @@ -79,6 +79,9 @@ }, "max_dhw_temperature": { "name": "Domestic hot water setpoint" + }, + "temperature_offset": { + "name": "Temperature offset" } }, "select": { diff --git a/tests/components/plugwise/test_number.py b/tests/components/plugwise/test_number.py index bccf257a433..6572a0df20e 100644 --- a/tests/components/plugwise/test_number.py +++ b/tests/components/plugwise/test_number.py @@ -69,3 +69,23 @@ async def test_adam_dhw_setpoint_change( mock_smile_adam_2.set_number_setpoint.assert_called_with( "max_dhw_temperature", "056ee145a816487eaa69243c3280f8bf", 55.0 ) + + +async def test_adam_temperature_offset_change( + hass: HomeAssistant, mock_smile_adam: MagicMock, init_integration: MockConfigEntry +) -> None: + """Test changing of number entities.""" + await hass.services.async_call( + NUMBER_DOMAIN, + SERVICE_SET_VALUE, + { + ATTR_ENTITY_ID: "number.zone_thermostat_jessie_temperature_offset", + ATTR_VALUE: 1.0, + }, + blocking=True, + ) + + assert mock_smile_adam.set_temperature_offset.call_count == 1 + mock_smile_adam.set_temperature_offset.assert_called_with( + "temperature_offset", "6a3bf693d05e48e0b460c815a4fdd09d", 1.0 + )