From bef669d81d7287954185f7e60c5667272b2652d6 Mon Sep 17 00:00:00 2001 From: Saibotk Date: Sat, 8 Apr 2023 00:20:15 +0200 Subject: [PATCH] fix: get_devices only checks for the first type When testing this in Homeassistant with an XT2 Plus, i noticed, that the get_devices() function checks the type by checking if the type is found in the parameter generic_type. But for this to work and check for the type ids used in XT2 etc, we need to fix this to not only check for the first entry in the passed list. --- lupupy/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lupupy/__init__.py b/lupupy/__init__.py index a789cc6..a29013c 100644 --- a/lupupy/__init__.py +++ b/lupupy/__init__.py @@ -312,7 +312,7 @@ def get_devices(self, refresh=False, generic_type=None): if generic_type: devices = [] for device in self._devices.values(): - if device.type is not None and device.type in generic_type[0]: + if device.type is not None and device.type in generic_type: devices.append(device) return devices