From 2e7c3bdd644b9dc7260254547e158d72f031e43e Mon Sep 17 00:00:00 2001 From: Harley Watson Date: Tue, 15 Jun 2021 18:18:57 +0100 Subject: [PATCH] search for the Glow Display deviceTypeId --- custom_components/hildebrandglow/glow.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/custom_components/hildebrandglow/glow.py b/custom_components/hildebrandglow/glow.py index f3baa54..7ffedd0 100644 --- a/custom_components/hildebrandglow/glow.py +++ b/custom_components/hildebrandglow/glow.py @@ -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"]