Bump zwave-js-server-python to 0.37.0 (#72395)

This commit is contained in:
Raman Gupta 2022-05-25 13:46:55 -04:00 committed by GitHub
parent c8c4bf6c37
commit fe3fa0ae17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 445 additions and 24 deletions

View file

@ -114,8 +114,7 @@ DRY_RUN = "dry_run"
# constants for inclusion # constants for inclusion
INCLUSION_STRATEGY = "inclusion_strategy" INCLUSION_STRATEGY = "inclusion_strategy"
# Remove type ignore when bumping library to 0.37.0 INCLUSION_STRATEGY_NOT_SMART_START: dict[
INCLUSION_STRATEGY_NOT_SMART_START: dict[ # type: ignore[misc]
int, int,
Literal[ Literal[
InclusionStrategy.DEFAULT, InclusionStrategy.DEFAULT,

View file

@ -238,7 +238,7 @@ class ZWaveClimate(ZWaveBaseEntity, ClimateEntity):
if self._current_mode is None or self._current_mode.value is None: if self._current_mode is None or self._current_mode.value is None:
# Thermostat(valve) with no support for setting a mode is considered heating-only # Thermostat(valve) with no support for setting a mode is considered heating-only
return [ThermostatSetpointType.HEATING] return [ThermostatSetpointType.HEATING]
return THERMOSTAT_MODE_SETPOINT_MAP.get(int(self._current_mode.value), []) # type: ignore[no-any-return] return THERMOSTAT_MODE_SETPOINT_MAP.get(int(self._current_mode.value), [])
@property @property
def temperature_unit(self) -> str: def temperature_unit(self) -> str:

View file

@ -326,7 +326,9 @@ async def async_get_action_capabilities(
vol.Required(ATTR_COMMAND_CLASS): vol.In( vol.Required(ATTR_COMMAND_CLASS): vol.In(
{ {
CommandClass(cc.id).value: cc.name CommandClass(cc.id).value: cc.name
for cc in sorted(node.command_classes, key=lambda cc: cc.name) # type: ignore[no-any-return] for cc in sorted(
node.command_classes, key=lambda cc: cc.name
)
} }
), ),
vol.Required(ATTR_PROPERTY): cv.string, vol.Required(ATTR_PROPERTY): cv.string,

View file

@ -221,7 +221,9 @@ async def async_get_condition_capabilities(
vol.Required(ATTR_COMMAND_CLASS): vol.In( vol.Required(ATTR_COMMAND_CLASS): vol.In(
{ {
CommandClass(cc.id).value: cc.name CommandClass(cc.id).value: cc.name
for cc in sorted(node.command_classes, key=lambda cc: cc.name) # type: ignore[no-any-return] for cc in sorted(
node.command_classes, key=lambda cc: cc.name
)
if cc.id != CommandClass.CONFIGURATION if cc.id != CommandClass.CONFIGURATION
} }
), ),

View file

@ -534,7 +534,9 @@ async def async_get_trigger_capabilities(
vol.Required(ATTR_COMMAND_CLASS): vol.In( vol.Required(ATTR_COMMAND_CLASS): vol.In(
{ {
CommandClass(cc.id).value: cc.name CommandClass(cc.id).value: cc.name
for cc in sorted(node.command_classes, key=lambda cc: cc.name) # type: ignore[no-any-return] for cc in sorted(
node.command_classes, key=lambda cc: cc.name
)
if cc.id != CommandClass.CONFIGURATION if cc.id != CommandClass.CONFIGURATION
} }
), ),

View file

@ -505,7 +505,7 @@ class ConfigurableFanValueMappingDataTemplate(
self, value: ZwaveValue self, value: ZwaveValue
) -> dict[str, ZwaveConfigurationValue | None]: ) -> dict[str, ZwaveConfigurationValue | None]:
"""Resolve helper class data for a discovered value.""" """Resolve helper class data for a discovered value."""
zwave_value = cast( # type: ignore[redundant-cast] zwave_value = cast(
Union[ZwaveConfigurationValue, None], Union[ZwaveConfigurationValue, None],
self._get_value_from_id(value.node, self.configuration_option), self._get_value_from_id(value.node, self.configuration_option),
) )

View file

@ -3,7 +3,7 @@
"name": "Z-Wave JS", "name": "Z-Wave JS",
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/zwave_js", "documentation": "https://www.home-assistant.io/integrations/zwave_js",
"requirements": ["zwave-js-server-python==0.36.1"], "requirements": ["zwave-js-server-python==0.37.0"],
"codeowners": ["@home-assistant/z-wave"], "codeowners": ["@home-assistant/z-wave"],
"dependencies": ["usb", "http", "websocket_api"], "dependencies": ["usb", "http", "websocket_api"],
"iot_class": "local_push", "iot_class": "local_push",

View file

@ -2528,7 +2528,7 @@ zigpy==0.45.1
zm-py==0.5.2 zm-py==0.5.2
# homeassistant.components.zwave_js # homeassistant.components.zwave_js
zwave-js-server-python==0.36.1 zwave-js-server-python==0.37.0
# homeassistant.components.zwave_me # homeassistant.components.zwave_me
zwave_me_ws==0.2.4 zwave_me_ws==0.2.4

View file

@ -1665,7 +1665,7 @@ zigpy-znp==0.7.0
zigpy==0.45.1 zigpy==0.45.1
# homeassistant.components.zwave_js # homeassistant.components.zwave_js
zwave-js-server-python==0.36.1 zwave-js-server-python==0.37.0
# homeassistant.components.zwave_me # homeassistant.components.zwave_me
zwave_me_ws==0.2.4 zwave_me_ws==0.2.4

View file

@ -51,7 +51,14 @@
"index": 0, "index": 0,
"installerIcon": 1792, "installerIcon": 1792,
"userIcon": 1792, "userIcon": 1792,
"commandClasses": [] "commandClasses": [
{
"id": 50,
"name": "Meter",
"version": 3,
"isSecure": false
}
]
} }
], ],
"values": [ "values": [

View file

@ -126,7 +126,63 @@
"endpoints": [ "endpoints": [
{ {
"nodeId": 5, "nodeId": 5,
"index": 0 "index": 0,
"commandClasses": [
{
"id": 67,
"name": "Thermostat Setpoint",
"version": 2,
"isSecure": false
},
{
"id": 70,
"name": "Climate Control Schedule",
"version": 1,
"isSecure": false
},
{
"id": 114,
"name": "Manufacturer Specific",
"version": 1,
"isSecure": false
},
{
"id": 117,
"name": "Protection",
"version": 2,
"isSecure": false
},
{
"id": 128,
"name": "Battery",
"version": 1,
"isSecure": false
},
{
"id": 129,
"name": "Clock",
"version": 1,
"isSecure": false
},
{
"id": 132,
"name": "Wake Up",
"version": 1,
"isSecure": false
},
{
"id": 134,
"name": "Version",
"version": 1,
"isSecure": false
},
{
"id": 143,
"name": "Multi Command",
"version": 1,
"isSecure": false
}
]
} }
], ],
"values": [ "values": [

View file

@ -62,7 +62,123 @@
}, },
"mandatorySupportedCCs": [32, 114, 64, 67, 134], "mandatorySupportedCCs": [32, 114, 64, 67, 134],
"mandatoryControlledCCs": [] "mandatoryControlledCCs": []
} },
"commandClasses": [
{
"id": 49,
"name": "Multilevel Sensor",
"version": 5,
"isSecure": false
},
{
"id": 64,
"name": "Thermostat Mode",
"version": 2,
"isSecure": false
},
{
"id": 66,
"name": "Thermostat Operating State",
"version": 2,
"isSecure": false
},
{
"id": 67,
"name": "Thermostat Setpoint",
"version": 2,
"isSecure": false
},
{
"id": 68,
"name": "Thermostat Fan Mode",
"version": 1,
"isSecure": false
},
{
"id": 69,
"name": "Thermostat Fan State",
"version": 1,
"isSecure": false
},
{
"id": 89,
"name": "Association Group Information",
"version": 1,
"isSecure": false
},
{
"id": 90,
"name": "Device Reset Locally",
"version": 1,
"isSecure": false
},
{
"id": 94,
"name": "Z-Wave Plus Info",
"version": 2,
"isSecure": false
},
{
"id": 96,
"name": "Multi Channel",
"version": 4,
"isSecure": false
},
{
"id": 112,
"name": "Configuration",
"version": 1,
"isSecure": false
},
{
"id": 114,
"name": "Manufacturer Specific",
"version": 2,
"isSecure": false
},
{
"id": 122,
"name": "Firmware Update Meta Data",
"version": 3,
"isSecure": false
},
{
"id": 128,
"name": "Battery",
"version": 1,
"isSecure": false
},
{
"id": 129,
"name": "Clock",
"version": 1,
"isSecure": false
},
{
"id": 133,
"name": "Association",
"version": 2,
"isSecure": false
},
{
"id": 134,
"name": "Version",
"version": 2,
"isSecure": false
},
{
"id": 135,
"name": "Indicator",
"version": 1,
"isSecure": false
},
{
"id": 142,
"name": "Multi Channel Association",
"version": 3,
"isSecure": false
}
]
}, },
{ {
"nodeId": 26, "nodeId": 26,
@ -82,7 +198,123 @@
}, },
"mandatorySupportedCCs": [32, 114, 64, 67, 134], "mandatorySupportedCCs": [32, 114, 64, 67, 134],
"mandatoryControlledCCs": [] "mandatoryControlledCCs": []
} },
"commandClasses": [
{
"id": 49,
"name": "Multilevel Sensor",
"version": 5,
"isSecure": false
},
{
"id": 64,
"name": "Thermostat Mode",
"version": 2,
"isSecure": false
},
{
"id": 66,
"name": "Thermostat Operating State",
"version": 2,
"isSecure": false
},
{
"id": 67,
"name": "Thermostat Setpoint",
"version": 2,
"isSecure": false
},
{
"id": 68,
"name": "Thermostat Fan Mode",
"version": 1,
"isSecure": false
},
{
"id": 69,
"name": "Thermostat Fan State",
"version": 1,
"isSecure": false
},
{
"id": 89,
"name": "Association Group Information",
"version": 1,
"isSecure": false
},
{
"id": 90,
"name": "Device Reset Locally",
"version": 1,
"isSecure": false
},
{
"id": 94,
"name": "Z-Wave Plus Info",
"version": 2,
"isSecure": false
},
{
"id": 96,
"name": "Multi Channel",
"version": 4,
"isSecure": false
},
{
"id": 112,
"name": "Configuration",
"version": 1,
"isSecure": false
},
{
"id": 114,
"name": "Manufacturer Specific",
"version": 2,
"isSecure": false
},
{
"id": 122,
"name": "Firmware Update Meta Data",
"version": 3,
"isSecure": false
},
{
"id": 128,
"name": "Battery",
"version": 1,
"isSecure": false
},
{
"id": 129,
"name": "Clock",
"version": 1,
"isSecure": false
},
{
"id": 133,
"name": "Association",
"version": 2,
"isSecure": false
},
{
"id": 134,
"name": "Version",
"version": 2,
"isSecure": false
},
{
"id": 135,
"name": "Indicator",
"version": 1,
"isSecure": false
},
{
"id": 142,
"name": "Multi Channel Association",
"version": 3,
"isSecure": false
}
]
}, },
{ {
"nodeId": 26, "nodeId": 26,
@ -102,7 +334,123 @@
}, },
"mandatorySupportedCCs": [32, 49], "mandatorySupportedCCs": [32, 49],
"mandatoryControlledCCs": [] "mandatoryControlledCCs": []
} },
"commandClasses": [
{
"id": 49,
"name": "Multilevel Sensor",
"version": 5,
"isSecure": false
},
{
"id": 64,
"name": "Thermostat Mode",
"version": 2,
"isSecure": false
},
{
"id": 66,
"name": "Thermostat Operating State",
"version": 2,
"isSecure": false
},
{
"id": 67,
"name": "Thermostat Setpoint",
"version": 2,
"isSecure": false
},
{
"id": 68,
"name": "Thermostat Fan Mode",
"version": 1,
"isSecure": false
},
{
"id": 69,
"name": "Thermostat Fan State",
"version": 1,
"isSecure": false
},
{
"id": 89,
"name": "Association Group Information",
"version": 1,
"isSecure": false
},
{
"id": 90,
"name": "Device Reset Locally",
"version": 1,
"isSecure": false
},
{
"id": 94,
"name": "Z-Wave Plus Info",
"version": 2,
"isSecure": false
},
{
"id": 96,
"name": "Multi Channel",
"version": 4,
"isSecure": false
},
{
"id": 112,
"name": "Configuration",
"version": 1,
"isSecure": false
},
{
"id": 114,
"name": "Manufacturer Specific",
"version": 2,
"isSecure": false
},
{
"id": 122,
"name": "Firmware Update Meta Data",
"version": 3,
"isSecure": false
},
{
"id": 128,
"name": "Battery",
"version": 1,
"isSecure": false
},
{
"id": 129,
"name": "Clock",
"version": 1,
"isSecure": false
},
{
"id": 133,
"name": "Association",
"version": 2,
"isSecure": false
},
{
"id": 134,
"name": "Version",
"version": 2,
"isSecure": false
},
{
"id": 135,
"name": "Indicator",
"version": 1,
"isSecure": false
},
{
"id": 142,
"name": "Multi Channel Association",
"version": 3,
"isSecure": false
}
]
} }
], ],
"values": [ "values": [

View file

@ -1147,6 +1147,8 @@ async def test_get_provisioning_entries(hass, integration, client, hass_ws_clien
{ {
"dsk": "test", "dsk": "test",
"security_classes": [SecurityClass.S2_UNAUTHENTICATED], "security_classes": [SecurityClass.S2_UNAUTHENTICATED],
"requested_security_classes": None,
"status": 0,
"additional_properties": {"fake": "test"}, "additional_properties": {"fake": "test"},
} }
] ]
@ -1235,6 +1237,8 @@ async def test_parse_qr_code_string(hass, integration, client, hass_ws_client):
"max_inclusion_request_interval": 1, "max_inclusion_request_interval": 1,
"uuid": "test", "uuid": "test",
"supported_protocols": [Protocols.ZWAVE], "supported_protocols": [Protocols.ZWAVE],
"status": 0,
"requested_security_classes": None,
"additional_properties": {}, "additional_properties": {},
} }
@ -3535,6 +3539,7 @@ async def test_check_for_config_updates(hass, client, integration, hass_ws_clien
client.async_send_command.return_value = { client.async_send_command.return_value = {
"updateAvailable": True, "updateAvailable": True,
"newVersion": "test", "newVersion": "test",
"installedVersion": "test",
} }
await ws_client.send_json( await ws_client.send_json(
{ {

View file

@ -1817,7 +1817,7 @@ async def test_invoke_cc_api(
device_radio_thermostat.id, device_radio_thermostat.id,
device_danfoss.id, device_danfoss.id,
], ],
ATTR_COMMAND_CLASS: 132, ATTR_COMMAND_CLASS: 67,
ATTR_ENDPOINT: 0, ATTR_ENDPOINT: 0,
ATTR_METHOD_NAME: "someMethod", ATTR_METHOD_NAME: "someMethod",
ATTR_PARAMETERS: [1, 2], ATTR_PARAMETERS: [1, 2],
@ -1827,7 +1827,7 @@ async def test_invoke_cc_api(
assert len(client.async_send_command.call_args_list) == 1 assert len(client.async_send_command.call_args_list) == 1
args = client.async_send_command.call_args[0][0] args = client.async_send_command.call_args[0][0]
assert args["command"] == "endpoint.invoke_cc_api" assert args["command"] == "endpoint.invoke_cc_api"
assert args["commandClass"] == 132 assert args["commandClass"] == 67
assert args["endpoint"] == 0 assert args["endpoint"] == 0
assert args["methodName"] == "someMethod" assert args["methodName"] == "someMethod"
assert args["args"] == [1, 2] assert args["args"] == [1, 2]
@ -1839,7 +1839,7 @@ async def test_invoke_cc_api(
assert len(client.async_send_command_no_wait.call_args_list) == 1 assert len(client.async_send_command_no_wait.call_args_list) == 1
args = client.async_send_command_no_wait.call_args[0][0] args = client.async_send_command_no_wait.call_args[0][0]
assert args["command"] == "endpoint.invoke_cc_api" assert args["command"] == "endpoint.invoke_cc_api"
assert args["commandClass"] == 132 assert args["commandClass"] == 67
assert args["endpoint"] == 0 assert args["endpoint"] == 0
assert args["methodName"] == "someMethod" assert args["methodName"] == "someMethod"
assert args["args"] == [1, 2] assert args["args"] == [1, 2]
@ -1870,7 +1870,7 @@ async def test_invoke_cc_api(
"select.living_connect_z_thermostat_local_protection_state", "select.living_connect_z_thermostat_local_protection_state",
"sensor.living_connect_z_thermostat_node_status", "sensor.living_connect_z_thermostat_node_status",
], ],
ATTR_COMMAND_CLASS: 132, ATTR_COMMAND_CLASS: 67,
ATTR_METHOD_NAME: "someMethod", ATTR_METHOD_NAME: "someMethod",
ATTR_PARAMETERS: [1, 2], ATTR_PARAMETERS: [1, 2],
}, },
@ -1879,7 +1879,7 @@ async def test_invoke_cc_api(
assert len(client.async_send_command.call_args_list) == 1 assert len(client.async_send_command.call_args_list) == 1
args = client.async_send_command.call_args[0][0] args = client.async_send_command.call_args[0][0]
assert args["command"] == "endpoint.invoke_cc_api" assert args["command"] == "endpoint.invoke_cc_api"
assert args["commandClass"] == 132 assert args["commandClass"] == 67
assert args["endpoint"] == 0 assert args["endpoint"] == 0
assert args["methodName"] == "someMethod" assert args["methodName"] == "someMethod"
assert args["args"] == [1, 2] assert args["args"] == [1, 2]
@ -1891,7 +1891,7 @@ async def test_invoke_cc_api(
assert len(client.async_send_command_no_wait.call_args_list) == 1 assert len(client.async_send_command_no_wait.call_args_list) == 1
args = client.async_send_command_no_wait.call_args[0][0] args = client.async_send_command_no_wait.call_args[0][0]
assert args["command"] == "endpoint.invoke_cc_api" assert args["command"] == "endpoint.invoke_cc_api"
assert args["commandClass"] == 132 assert args["commandClass"] == 67
assert args["endpoint"] == 0 assert args["endpoint"] == 0
assert args["methodName"] == "someMethod" assert args["methodName"] == "someMethod"
assert args["args"] == [1, 2] assert args["args"] == [1, 2]
@ -1916,7 +1916,7 @@ async def test_invoke_cc_api(
device_danfoss.id, device_danfoss.id,
device_radio_thermostat.id, device_radio_thermostat.id,
], ],
ATTR_COMMAND_CLASS: 132, ATTR_COMMAND_CLASS: 67,
ATTR_ENDPOINT: 0, ATTR_ENDPOINT: 0,
ATTR_METHOD_NAME: "someMethod", ATTR_METHOD_NAME: "someMethod",
ATTR_PARAMETERS: [1, 2], ATTR_PARAMETERS: [1, 2],
@ -1926,7 +1926,7 @@ async def test_invoke_cc_api(
assert len(client.async_send_command.call_args_list) == 1 assert len(client.async_send_command.call_args_list) == 1
args = client.async_send_command.call_args[0][0] args = client.async_send_command.call_args[0][0]
assert args["command"] == "endpoint.invoke_cc_api" assert args["command"] == "endpoint.invoke_cc_api"
assert args["commandClass"] == 132 assert args["commandClass"] == 67
assert args["endpoint"] == 0 assert args["endpoint"] == 0
assert args["methodName"] == "someMethod" assert args["methodName"] == "someMethod"
assert args["args"] == [1, 2] assert args["args"] == [1, 2]
@ -1938,7 +1938,7 @@ async def test_invoke_cc_api(
assert len(client.async_send_command_no_wait.call_args_list) == 1 assert len(client.async_send_command_no_wait.call_args_list) == 1
args = client.async_send_command_no_wait.call_args[0][0] args = client.async_send_command_no_wait.call_args[0][0]
assert args["command"] == "endpoint.invoke_cc_api" assert args["command"] == "endpoint.invoke_cc_api"
assert args["commandClass"] == 132 assert args["commandClass"] == 67
assert args["endpoint"] == 0 assert args["endpoint"] == 0
assert args["methodName"] == "someMethod" assert args["methodName"] == "someMethod"
assert args["args"] == [1, 2] assert args["args"] == [1, 2]