Send target temp to Shelly TRV in F when needed (#108188)

This commit is contained in:
John Allen
2024-01-17 22:06:11 +02:00
committed by GitHub
parent 97956702c9
commit a385ca93bd
2 changed files with 38 additions and 0 deletions
+23
View File
@@ -146,6 +146,29 @@ async def test_climate_set_temperature(
mock_block_device.http_request.assert_called_once_with(
"get", "thermostat/0", {"target_t_enabled": 1, "target_t": "23.0"}
)
mock_block_device.http_request.reset_mock()
# Test conversion from C to F
monkeypatch.setattr(
mock_block_device,
"settings",
{
"thermostats": [
{"target_t": {"units": "F"}},
]
},
)
await hass.services.async_call(
CLIMATE_DOMAIN,
SERVICE_SET_TEMPERATURE,
{ATTR_ENTITY_ID: ENTITY_ID, ATTR_TEMPERATURE: 20},
blocking=True,
)
mock_block_device.http_request.assert_called_once_with(
"get", "thermostat/0", {"target_t_enabled": 1, "target_t": "68.0"}
)
async def test_climate_set_preset_mode(