Skip to content

Commit

Permalink
Bump zwave-js-server-python to 0.56.0 (#117288)
Browse files Browse the repository at this point in the history
* Bump zwave-js-server-python to 0.56.0

* Fix deprecation warning

* Fix tests

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
  • Loading branch information
raman325 and balloob committed May 13, 2024
1 parent 492ef67 commit 61b906e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/zwave_js/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"iot_class": "local_push",
"loggers": ["zwave_js_server"],
"quality_scale": "platinum",
"requirements": ["pyserial==3.5", "zwave-js-server-python==0.55.4"],
"requirements": ["pyserial==3.5", "zwave-js-server-python==0.56.0"],
"usb": [
{
"vid": "0658",
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2971,7 +2971,7 @@ zigpy==0.64.0
zm-py==0.5.4

# homeassistant.components.zwave_js
zwave-js-server-python==0.55.4
zwave-js-server-python==0.56.0

# homeassistant.components.zwave_me
zwave-me-ws==0.4.3
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2309,7 +2309,7 @@ zigpy-znp==0.12.1
zigpy==0.64.0

# homeassistant.components.zwave_js
zwave-js-server-python==0.55.4
zwave-js-server-python==0.56.0

# homeassistant.components.zwave_me
zwave-me-ws==0.4.3
15 changes: 11 additions & 4 deletions tests/components/zwave_js/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from copy import deepcopy
from http import HTTPStatus
from io import BytesIO
import json
from typing import Any
from unittest.mock import patch
Expand Down Expand Up @@ -1335,6 +1336,7 @@ async def test_get_provisioning_entries(
"security_classes": [SecurityClass.S2_UNAUTHENTICATED],
"requested_security_classes": None,
"status": 0,
"protocol": None,
"additional_properties": {"fake": "test"},
}
]
Expand Down Expand Up @@ -1421,6 +1423,7 @@ async def test_parse_qr_code_string(
"manufacturer_id": 1,
"product_type": 1,
"product_id": 1,
"protocol": None,
"application_version": "test",
"max_inclusion_request_interval": 1,
"uuid": "test",
Expand Down Expand Up @@ -3089,7 +3092,9 @@ async def test_firmware_upload_view(
f"/api/zwave_js/firmware/upload/{device.id}", data=data
)

update_data = NodeFirmwareUpdateData("file", bytes(10))
update_data = NodeFirmwareUpdateData(
"file", b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
)
for attr, value in expected_data.items():
setattr(update_data, attr, value)

Expand Down Expand Up @@ -3129,7 +3134,9 @@ async def test_firmware_upload_view_controller(
)
mock_node_cmd.assert_not_called()
assert mock_controller_cmd.call_args[0][1:2] == (
ControllerFirmwareUpdateData("file", bytes(10)),
ControllerFirmwareUpdateData(
"file", b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
),
)
assert mock_controller_cmd.call_args[1] == {
"additional_user_agent_components": {"HomeAssistant": "0.0.0"},
Expand Down Expand Up @@ -3166,7 +3173,7 @@ async def test_firmware_upload_view_invalid_payload(
client = await hass_client()
resp = await client.post(
f"/api/zwave_js/firmware/upload/{device.id}",
data={"wrong_key": bytes(10)},
data={"wrong_key": BytesIO(bytes(10))},
)
assert resp.status == HTTPStatus.BAD_REQUEST

Expand All @@ -3184,7 +3191,7 @@ async def test_firmware_upload_view_no_driver(
aiohttp_client = await hass_client()
resp = await aiohttp_client.post(
f"/api/zwave_js/firmware/upload/{device.id}",
data={"wrong_key": bytes(10)},
data={"wrong_key": BytesIO(bytes(10))},
)
assert resp.status == HTTPStatus.NOT_FOUND

Expand Down

0 comments on commit 61b906e

Please sign in to comment.