Add Plugwise temperature_offset number (#100029)

Add temperature_offset number
This commit is contained in:
Bouwe Westerdijk 2023-09-10 11:34:09 +02:00 committed by GitHub
parent 1f3b3b1be3
commit c01a9987b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 0 deletions

View File

@ -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,
),
)

View File

@ -79,6 +79,9 @@
},
"max_dhw_temperature": {
"name": "Domestic hot water setpoint"
},
"temperature_offset": {
"name": "Temperature offset"
}
},
"select": {

View File

@ -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
)