mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +00:00
Discover additional ozw thermostats lacking mode support (#40799)
* Discover more thermostats without mode support * Add tests
This commit is contained in:
parent
9d56d3bb31
commit
c693d8af14
@ -136,6 +136,7 @@ DISCOVERY_SCHEMAS = (
|
|||||||
const.DISC_GENERIC_DEVICE_CLASS: (const_ozw.GENERIC_TYPE_THERMOSTAT,),
|
const.DISC_GENERIC_DEVICE_CLASS: (const_ozw.GENERIC_TYPE_THERMOSTAT,),
|
||||||
const.DISC_SPECIFIC_DEVICE_CLASS: (
|
const.DISC_SPECIFIC_DEVICE_CLASS: (
|
||||||
const_ozw.SPECIFIC_TYPE_SETPOINT_THERMOSTAT,
|
const_ozw.SPECIFIC_TYPE_SETPOINT_THERMOSTAT,
|
||||||
|
const_ozw.SPECIFIC_TYPE_NOT_USED,
|
||||||
),
|
),
|
||||||
const.DISC_VALUES: {
|
const.DISC_VALUES: {
|
||||||
const.DISC_PRIMARY: {
|
const.DISC_PRIMARY: {
|
||||||
|
@ -281,3 +281,47 @@ async def test_climate(hass, climate_data, sent_messages, climate_msg, caplog):
|
|||||||
)
|
)
|
||||||
assert len(sent_messages) == 11
|
assert len(sent_messages) == 11
|
||||||
assert "does not support setting a mode" in caplog.text
|
assert "does not support setting a mode" in caplog.text
|
||||||
|
|
||||||
|
# test thermostat device without a mode commandclass
|
||||||
|
state = hass.states.get("climate.secure_srt321_zwave_stat_tx_heating_1")
|
||||||
|
assert state is not None
|
||||||
|
assert state.state == HVAC_MODE_HEAT
|
||||||
|
assert state.attributes[ATTR_HVAC_MODES] == [
|
||||||
|
HVAC_MODE_HEAT,
|
||||||
|
]
|
||||||
|
assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 29.0
|
||||||
|
assert round(state.attributes[ATTR_TEMPERATURE], 0) == 16
|
||||||
|
assert state.attributes.get(ATTR_TARGET_TEMP_LOW) is None
|
||||||
|
assert state.attributes.get(ATTR_TARGET_TEMP_HIGH) is None
|
||||||
|
assert state.attributes.get(ATTR_PRESET_MODE) is None
|
||||||
|
assert state.attributes.get(ATTR_PRESET_MODES) is None
|
||||||
|
|
||||||
|
# Test set target temperature
|
||||||
|
await hass.services.async_call(
|
||||||
|
"climate",
|
||||||
|
"set_temperature",
|
||||||
|
{
|
||||||
|
"entity_id": "climate.secure_srt321_zwave_stat_tx_heating_1",
|
||||||
|
"temperature": 28.0,
|
||||||
|
},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
assert len(sent_messages) == 12
|
||||||
|
msg = sent_messages[-1]
|
||||||
|
assert msg["topic"] == "OpenZWave/1/command/setvalue/"
|
||||||
|
assert msg["payload"] == {
|
||||||
|
"Value": 28.0,
|
||||||
|
"ValueIDKey": 281475267215378,
|
||||||
|
}
|
||||||
|
|
||||||
|
await hass.services.async_call(
|
||||||
|
"climate",
|
||||||
|
"set_hvac_mode",
|
||||||
|
{
|
||||||
|
"entity_id": "climate.secure_srt321_zwave_stat_tx_heating_1",
|
||||||
|
"hvac_mode": HVAC_MODE_HEAT,
|
||||||
|
},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
assert len(sent_messages) == 12
|
||||||
|
assert "does not support setting a mode" in caplog.text
|
||||||
|
32
tests/fixtures/ozw/climate_network_dump.csv
vendored
32
tests/fixtures/ozw/climate_network_dump.csv
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user