From 10082f769b35a29943b14bf8d03466779becddc7 Mon Sep 17 00:00:00 2001
From: jkerdreu <jkerdreu@b32b6428-25c9-4566-ad07-03861ab6144f>
Date: Mon, 31 Oct 2022 00:20:33 +0000
Subject: [PATCH] Added product_id which is missing

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@3028 b32b6428-25c9-4566-ad07-03861ab6144f
---
 devices/protocols/Yeelight/xaal/yeelight/devices.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/devices/protocols/Yeelight/xaal/yeelight/devices.py b/devices/protocols/Yeelight/xaal/yeelight/devices.py
index 0397f297..f65a8d1e 100644
--- a/devices/protocols/Yeelight/xaal/yeelight/devices.py
+++ b/devices/protocols/Yeelight/xaal/yeelight/devices.py
@@ -101,6 +101,9 @@ class YeelightDev(object):
     def _update_properties(self):
         properties = self.bulb.get_properties()
         self.on_properties(properties)
+        # we need to be connected to find out which model
+        if self.dev.product_id == None:
+            self.dev.product_id = self.bulb.bulb_type
 
 
 class RGBW(YeelightDev):
-- 
GitLab