Skip to content

Commit

Permalink
Bump zigpy from 0.70.0 to 0.71.0 (#281)
Browse files Browse the repository at this point in the history
* 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](zigpy/zigpy@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] <[email protected]>

* Reformat entity discovery error unit test

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: puddly <[email protected]>
  • Loading branch information
dependabot[bot] and puddly authored Oct 30, 2024
1 parent 315c06f commit 4a8c387
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
41 changes: 17 additions & 24 deletions tests/test_discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import enum
import json
import pathlib
import re
from unittest import mock
from unittest.mock import AsyncMock

Expand Down Expand Up @@ -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, <ClusterType.Server: 0>)"
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, <ClusterType.Server: 0>)"
) 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}, <ClusterType.Server: 0>)"
assert f"{m1}{m2}{m3}" in caplog.text

# fmt: off
entity_details = (
"{'cluster_details': (1, 6, <ClusterType.Server: 0>), 'entity_metadata': "
"ZCLSensorMetadata(entity_platform=<EntityPlatform.SENSOR: 'sensor'>, "
"entity_type=<EntityType.CONFIG: 'config'>, cluster_id=6, endpoint_id=1, "
"cluster_type=<ClusterType.Server: 0>, 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}, <ClusterType.Server: 0>)"
) 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]
Expand Down

0 comments on commit 4a8c387

Please sign in to comment.