From 731de4e96cfe83d2dba73409bc9a33b8aca4b334 Mon Sep 17 00:00:00 2001 From: puddly <32534428+puddly@users.noreply.github.com> Date: Mon, 13 Mar 2023 17:18:54 -0400 Subject: [PATCH 1/3] Bump pre-commit dependencies (#533) --- .pre-commit-config.yaml | 8 ++++---- bellows/types/named.py | 2 +- tests/test_application.py | 1 - tests/test_commands.py | 12 ++++++------ tests/test_multicast.py | 2 -- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 20f6215b..201b5d80 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,21 +1,21 @@ repos: - repo: https://github.com/psf/black - rev: 22.3.0 + rev: 23.1.0 hooks: - id: black args: - --safe - --quiet - repo: https://github.com/pycqa/flake8 - rev: 3.8.4 + rev: 6.0.0 hooks: - id: flake8 - repo: https://github.com/PyCQA/isort - rev: 5.5.2 + rev: 5.12.0 hooks: - id: isort - repo: https://github.com/codespell-project/codespell - rev: v1.17.1 + rev: v2.2.4 hooks: - id: codespell args: diff --git a/bellows/types/named.py b/bellows/types/named.py index 1099d429..41db3a4b 100644 --- a/bellows/types/named.py +++ b/bellows/types/named.py @@ -254,7 +254,7 @@ class EzspStatus(basic.enum8): ERROR_SECURITY_PARAMETERS_NOT_SET = 0x48 # Received frame with unsupported control byte ERROR_UNSUPPORTED_CONTROL = 0x49 - # Received frame is unsecure, when security is established + # Received frame is insecure, when security is established ERROR_UNSECURE_FRAME = 0x4A # Incompatible ASH version ASH_ERROR_VERSION = 0x50 diff --git a/tests/test_application.py b/tests/test_application.py index 025af109..78f01839 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -571,7 +571,6 @@ async def test_permit_with_key_ieee(app, ieee, version, tc_policy_count, ezsp_ty async def test_permit_with_key_invalid_install_code(app, ieee): - with pytest.raises(Exception): await app.permit_with_key( ieee, bytes([0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88]), 60 diff --git a/tests/test_commands.py b/tests/test_commands.py index 0792929d..870e0c23 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -41,15 +41,15 @@ def test_ids(commands): def test_parms(commands): """Test that parameter descriptions seem valid""" - for command, parms in commands.items(): - assert isinstance(parms[1], tuple), command - assert isinstance(parms[2], tuple), command + for command, params in commands.items(): + assert isinstance(params[1], tuple), command + assert isinstance(params[2], tuple), command def test_handlers(commands): """Test that handler methods only have responses""" - for command, parms in commands.items(): + for command, params in commands.items(): if not command.endswith("Handler"): continue - assert len(parms[1]) == 0, command - assert len(parms[2]) > 0, command + assert len(params[1]) == 0, command + assert len(params[2]) > 0, command diff --git a/tests/test_multicast.py b/tests/test_multicast.py index 47d5a6ee..0bd3c722 100644 --- a/tests/test_multicast.py +++ b/tests/test_multicast.py @@ -47,7 +47,6 @@ async def mock_get(*args): async def test_initialize_fail_configured_size(multicast): - multicast._ezsp.getConfigurationValue.return_value = t.EmberStatus.ERR_FATAL, 16 await multicast._initialize() ezsp = multicast._ezsp @@ -75,7 +74,6 @@ async def mock_get(*args): async def test_startup(multicast): - coordinator = MagicMock() ep1 = MagicMock(spec_set=Endpoint) ep1.member_of = [sentinel.grp, sentinel.grp, sentinel.grp] From e700caf2a50454d0060c3fcd5f67f4b49ebfce46 Mon Sep 17 00:00:00 2001 From: "David F. Mulcahey" Date: Mon, 13 Mar 2023 17:19:27 -0400 Subject: [PATCH 2/3] Change MTOR constants (#532) Change the MTOR constants to prevent multicast floods on the Zigbee network --- bellows/ezsp/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bellows/ezsp/__init__.py b/bellows/ezsp/__init__.py index f4435beb..28fed1e3 100644 --- a/bellows/ezsp/__init__.py +++ b/bellows/ezsp/__init__.py @@ -21,10 +21,10 @@ PROBE_TIMEOUT = 3 NETWORK_OPS_TIMEOUT = 10 LOGGER = logging.getLogger(__name__) -MTOR_MIN_INTERVAL = 10 -MTOR_MAX_INTERVAL = 90 -MTOR_ROUTE_ERROR_THRESHOLD = 4 -MTOR_DELIVERY_FAIL_THRESHOLD = 3 +MTOR_MIN_INTERVAL = 60 +MTOR_MAX_INTERVAL = 3600 +MTOR_ROUTE_ERROR_THRESHOLD = 8 +MTOR_DELIVERY_FAIL_THRESHOLD = 8 NETWORK_COORDINATOR_STARTUP_RESET_WAIT = 1 From a525dd1375b20fa7e3ad487624719a9d688e90b8 Mon Sep 17 00:00:00 2001 From: puddly <32534428+puddly@users.noreply.github.com> Date: Mon, 13 Mar 2023 17:25:13 -0400 Subject: [PATCH 3/3] Bump version to 0.34.10 --- bellows/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bellows/__init__.py b/bellows/__init__.py index 52cdb99d..579e4ed2 100644 --- a/bellows/__init__.py +++ b/bellows/__init__.py @@ -1,5 +1,5 @@ MAJOR_VERSION = 0 -MINOR_VERSION = 35 -PATCH_VERSION = "0.dev0" +MINOR_VERSION = 34 +PATCH_VERSION = "10" __short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__ = f"{__short_version__}.{PATCH_VERSION}"