From f1a81fc612a6da3ff716f95ba3fa3c00e1aeaf9e Mon Sep 17 00:00:00 2001 From: Eric Miller Date: Sat, 25 Nov 2023 06:09:03 -0600 Subject: [PATCH] Support LOM004 and LOM010 (#958) * Support LOM004 and LOM010 * Add logic forking --- BridgeEmulator/HueObjects/__init__.py | 6 +++--- BridgeEmulator/lights/light_types.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/BridgeEmulator/HueObjects/__init__.py b/BridgeEmulator/HueObjects/__init__.py index 9a1395036..19c5ab88c 100644 --- a/BridgeEmulator/HueObjects/__init__.py +++ b/BridgeEmulator/HueObjects/__init__.py @@ -356,12 +356,12 @@ def getV1Api(self): result = lightTypes[self.modelid]["v1_static"] result["config"] = self.config result["state"] = {"on": self.state["on"]} - if "bri" in self.state and self.modelid not in ["LOM001"]: + if "bri" in self.state and self.modelid not in ["LOM001", "LOM004", "LOM010"]: result["state"]["bri"] = self.state["bri"] - if "ct" in self.state and self.modelid not in ["LOM001", "LTW001"]: + if "ct" in self.state and self.modelid not in ["LOM001", "LOM004", "LOM010", "LTW001"]: result["state"]["ct"] = self.state["ct"] result["state"]["colormode"] = self.state["colormode"] - if "xy" in self.state and self.modelid not in ["LOM001", "LTW001", "LWB010"]: + if "xy" in self.state and self.modelid not in ["LOM001", "LOM004", "LOM010", "LTW001", "LWB010"]: result["state"]["xy"] = self.state["xy"] result["state"]["hue"] = self.state["hue"] result["state"]["sat"] = self.state["sat"] diff --git a/BridgeEmulator/lights/light_types.py b/BridgeEmulator/lights/light_types.py index 525a3650b..7b3068e63 100644 --- a/BridgeEmulator/lights/light_types.py +++ b/BridgeEmulator/lights/light_types.py @@ -101,6 +101,22 @@ lightTypes["LOM001"]["config"] = {"archetype": "plug","function": "functional","direction": "omnidirectional","startup":{"mode": "safety","configured": True}} lightTypes["LOM001"]["dynamics"] = {"status": "none", "status_values": ["none"]} +lightTypes["LOM004"] = {"v1_static": {"type": "On/Off plug-in unit","manufacturername": "Signify Netherlands B.V.","productname": "Hue Smart plug","swversion": "1.90.1","swconfigid": "A641B5AB","productid": "SmartPlug_OnOff_v01-00_01"}} +lightTypes["LOM004"]["v1_static"]["swupdate"] = {"state": "noupdates","lastinstall": "2020-12-09T19:13:52"} +lightTypes["LOM004"]["v1_static"]["capabilities"] = {"certified": True,"control": {},"streaming": {"renderer": False,"proxy": False}} +lightTypes["LOM004"]["device"] = {"certified": True,"manufacturer_name": "Signify Netherlands B.V.", "model_id": "LOM001", "product_archetype": "plug","product_name": "Hue Smart plug","software_version": "1.90.1"} +lightTypes["LOM004"]["state"] = {"on": False,"alert": "select","mode": "homeautomation","reachable": True} +lightTypes["LOM004"]["config"] = {"archetype": "plug","function": "functional","direction": "omnidirectional","startup":{"mode": "safety","configured": True}} +lightTypes["LOM004"]["dynamics"] = {"status": "none", "status_values": ["none"]} + +lightTypes["LOM010"] = {"v1_static": {"type": "On/Off plug-in unit","manufacturername": "Signify Netherlands B.V.","productname": "Hue Smart plug","swversion": "1.90.1","swconfigid": "A641B5AB","productid": "SmartPlug_OnOff_v01-00_01"}} +lightTypes["LOM010"]["v1_static"]["swupdate"] = {"state": "noupdates","lastinstall": "2020-12-09T19:13:52"} +lightTypes["LOM010"]["v1_static"]["capabilities"] = {"certified": True,"control": {},"streaming": {"renderer": False,"proxy": False}} +lightTypes["LOM010"]["device"] = {"certified": True,"manufacturer_name": "Signify Netherlands B.V.", "model_id": "LOM001", "product_archetype": "plug","product_name": "Hue Smart plug","software_version": "1.90.1"} +lightTypes["LOM010"]["state"] = {"on": False,"alert": "select","mode": "homeautomation","reachable": True} +lightTypes["LOM010"]["config"] = {"archetype": "plug","function": "functional","direction": "omnidirectional","startup":{"mode": "safety","configured": True}} +lightTypes["LOM010"]["dynamics"] = {"status": "none", "status_values": ["none"]} + archetype = {"tableshade":"table_shade", "flexiblelamp":"flexible_lamp",