Check all endpoints for zwave_js.climate fan mode and operating state (#48800)

* Check all endpoints for zwave_js.climate fan mode and operating state

* fix test
pull/48865/head
Raman Gupta 2021-04-08 10:53:20 -04:00 committed by GitHub
parent f1c4072d3c
commit 2768f202b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1096 additions and 730 deletions

View File

@ -169,11 +169,13 @@ class ZWaveClimate(ZWaveBaseEntity, ClimateEntity):
THERMOSTAT_MODE_PROPERTY,
CommandClass.THERMOSTAT_FAN_MODE,
add_to_watched_value_ids=True,
check_all_endpoints=True,
)
self._fan_state = self.get_zwave_value(
THERMOSTAT_OPERATING_STATE_PROPERTY,
CommandClass.THERMOSTAT_FAN_STATE,
add_to_watched_value_ids=True,
check_all_endpoints=True,
)
self._set_modes_and_presets()
self._supported_features = 0

View File

@ -348,7 +348,9 @@ async def test_thermostat_different_endpoints(
"""Test an entity with values on a different endpoint from the primary value."""
state = hass.states.get(CLIMATE_RADIO_THERMOSTAT_ENTITY)
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 22.5
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 22.8
assert state.attributes[ATTR_FAN_MODE] == "Auto low"
assert state.attributes[ATTR_FAN_STATE] == "Idle / off"
async def test_setpoint_thermostat(hass, client, climate_danfoss_lc_13, integration):

View File

@ -495,7 +495,7 @@ async def test_poll_value(
assert args["valueId"] == {
"commandClassName": "Thermostat Mode",
"commandClass": 64,
"endpoint": 0,
"endpoint": 1,
"property": "mode",
"propertyName": "mode",
"metadata": {
@ -503,19 +503,16 @@ async def test_poll_value(
"readable": True,
"writeable": True,
"min": 0,
"max": 31,
"max": 255,
"label": "Thermostat mode",
"states": {
"0": "Off",
"1": "Heat",
"2": "Cool",
"3": "Auto",
"11": "Energy heat",
"12": "Energy cool",
},
},
"value": 1,
"ccVersion": 2,
"value": 2,
"ccVersion": 0,
}
client.async_send_command.reset_mock()
@ -531,7 +528,7 @@ async def test_poll_value(
},
blocking=True,
)
assert len(client.async_send_command.call_args_list) == 8
assert len(client.async_send_command.call_args_list) == 7
# Test polling against an invalid entity raises ValueError
with pytest.raises(ValueError):