Skip to content
This repository has been archived by the owner on Apr 30, 2022. It is now read-only.

Commit

Permalink
search for the Glow Display deviceTypeId
Browse files Browse the repository at this point in the history
  • Loading branch information
unlobito committed Jun 15, 2021
1 parent ce7bb34 commit 2e7c3bd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion custom_components/hildebrandglow/glow.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,18 @@ def retrieve_devices(self) -> List[Dict[str, Any]]:
def retrieve_cad_hardwareId(self) -> str:
"""Locate the Consumer Access Device's hardware ID from the devices list."""
ZIGBEE_GLOW_STICK = "1027b6e8-9bfd-4dcb-8068-c73f6413cfaf"
ZIGBEE_GLOW_DISPLAY_SMETS2 = "b91cf82f-aafe-47f4-930a-b2ed1c7b2691"

devices = self.retrieve_devices()

cad: Dict[str, Any] = next(
(dev for dev in devices if dev["deviceTypeId"] == ZIGBEE_GLOW_STICK), {}
(
dev
for dev in devices
if dev["deviceTypeId"]
in [ZIGBEE_GLOW_STICK, ZIGBEE_GLOW_DISPLAY_SMETS2]
),
{},
)

self.hardwareId = cad["hardwareId"]
Expand Down

0 comments on commit 2e7c3bd

Please sign in to comment.