From 4a8c38778555001fb9b9cc322d87958350d04475 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 21:37:26 -0400 Subject: [PATCH] Bump zigpy from 0.70.0 to 0.71.0 (#281) * Bump zigpy from 0.70.0 to 0.71.0 Bumps [zigpy](https://github.com/zigpy/zigpy) from 0.70.0 to 0.71.0. - [Release notes](https://github.com/zigpy/zigpy/releases) - [Commits](https://github.com/zigpy/zigpy/compare/0.70.0...0.71.0) --- updated-dependencies: - dependency-name: zigpy dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Reformat entity discovery error unit test --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: puddly <32534428+puddly@users.noreply.github.com> --- pyproject.toml | 2 +- tests/test_discover.py | 41 +++++++++++++++++------------------------ 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 40017784a..716ca3bd8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ readme = "README.md" license = {text = "Apache-2.0"} requires-python = ">=3.12" dependencies = [ - "zigpy==0.70.0", + "zigpy==0.71.0", "bellows==0.42.0", "zigpy-znp==0.13.1", "zigpy-deconz==0.24.1", diff --git a/tests/test_discover.py b/tests/test_discover.py index 697f036e5..7455849e0 100644 --- a/tests/test_discover.py +++ b/tests/test_discover.py @@ -5,6 +5,7 @@ import enum import json import pathlib +import re from unittest import mock from unittest.mock import AsyncMock @@ -588,34 +589,26 @@ async def test_quirks_v2_entity_discovery_errors( ) zha_device = await join_zigpy_device(zha_gateway, zigpy_device) - m1 = f"Device: {str(zigpy_device.ieee)}-{zha_device.name} does not have an" - m2 = " endpoint with id: 3 - unable to create entity with cluster" - m3 = " details: (3, 6, )" - assert f"{m1}{m2}{m3}" in caplog.text + assert ( + f"Device: {zigpy_device.ieee}-{zha_device.name} does not have an" + " endpoint with id: 3 - unable to create entity with" + " cluster details: (3, 6, )" + ) in caplog.text time_cluster_id = zigpy.zcl.clusters.general.Time.cluster_id - m1 = f"Device: {str(zigpy_device.ieee)}-{zha_device.name} does not have a" - m2 = f" cluster with id: {time_cluster_id} - unable to create entity with " - m3 = f"cluster details: (1, {time_cluster_id}, )" - assert f"{m1}{m2}{m3}" in caplog.text - - # fmt: off - entity_details = ( - "{'cluster_details': (1, 6, ), 'entity_metadata': " - "ZCLSensorMetadata(entity_platform=, " - "entity_type=, cluster_id=6, endpoint_id=1, " - "cluster_type=, initially_disabled=False, " - "attribute_initialized_from_cache=True, translation_key='analog_input', " - "fallback_name='Analog input', attribute_name='off_wait_time', divisor=1, " - "multiplier=1, unit=None, device_class=None, state_class=None)}" + assert ( + f"Device: {zigpy_device.ieee}-{zha_device.name} does not have a" + f" cluster with id: {time_cluster_id} - unable to create entity with" + f" cluster details: (1, {time_cluster_id}, )" + ) in caplog.text + + device_info = f"{zigpy_device.ieee}-{zha_device.name}" + device_regex = ( + rf"Device: {re.escape(device_info)} has an entity with details: (.*?) that" + rf" does not have an entity class mapping - unable to create entity" ) - # fmt: on - - m1 = f"Device: {str(zigpy_device.ieee)}-{zha_device.name} has an entity with " - m2 = f"details: {entity_details} that does not have an entity class mapping - " - m3 = "unable to create entity" - assert f"{m1}{m2}{m3}" in caplog.text + assert re.search(device_regex, caplog.text) DEVICE_CLASS_TYPES = [NumberMetadata, BinarySensorMetadata, ZCLSensorMetadata]