From 2d7448db2e1606779d47b09b28589f51a39a1359 Mon Sep 17 00:00:00 2001 From: majki09 Date: Wed, 21 Aug 2024 14:16:43 +0200 Subject: [PATCH] v2.2.2: - fetching V1 Thinq devices has been failing, fixed now. --- example.py | 18 +++++++++++------- plugin.py | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/example.py b/example.py index 375076f..86ae241 100644 --- a/example.py +++ b/example.py @@ -56,14 +56,18 @@ def authenticate(gateway): def ls(client): """List the user's devices.""" - thinq1_devices = [dev for dev in client.devices if dev.platform_type == "thinq1"] - thinq2_devices = [dev for dev in client.devices if dev.platform_type == "thinq2"] + try: + thinq1_devices = [dev for dev in client.devices if dev.platform_type == "thinq1"] - if len(thinq1_devices) > 0: - print("\nthinq1 devices: {}".format(len(thinq1_devices))) - print("WARNING! Following devices are V1 LG API and will likely NOT work with this domoticz plugin!\n") - for device in thinq1_devices: - print("{0.id}: {0.name} ({0.type.name} {0.model_id} / {0.platform_type})".format(device)) + if len(thinq1_devices) > 0: + print("\nthinq1 devices: {}".format(len(thinq1_devices))) + print("WARNING! Following devices are V1 LG API and will likely NOT work with this domoticz plugin!\n") + for device in thinq1_devices: + print("{0.id}: {0.name} ({0.type.name} {0.model_id} / {0.platform_type})".format(device)) + except TypeError: + print("No thinq1 devices found or there was some LG server error.") + + thinq2_devices = [dev for dev in client.devices if dev.platform_type == "thinq2"] print("\nthinq2 devices: {}".format(len(thinq2_devices))) if len(thinq2_devices) > 0: diff --git a/plugin.py b/plugin.py index 0c09c2c..a70b4a9 100644 --- a/plugin.py +++ b/plugin.py @@ -5,7 +5,7 @@ # Author: majki # """ - +

LG ThinQ domoticz plugin


Plugin uses LG API v2. All API interface (with some mods) comes from github.com/no2chem/wideq.