Skip to content

Commit

Permalink
Adds LCX006 support (#938)
Browse files Browse the repository at this point in the history
* Adds LCX006 support

* Added to light_types
  • Loading branch information
j-simian authored Oct 17, 2023
1 parent f905cf0 commit 5249384
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
15 changes: 8 additions & 7 deletions BridgeEmulator/HueObjects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ def getBridgeHome(self):
def getV2Api(self):
result = {}
result["alert"] = {"action_values": ["breathe"]}
if self.modelid in ["LCX002", "915005987201", "LCX004"]:
# gradient lights
if self.modelid in ["LCX002", "915005987201", "LCX004", "LCX006"]:
result["effects"] = {
"effect_values": [
"no_effect",
Expand All @@ -502,7 +503,7 @@ def getV2Api(self):
"points_capable": self.protocol_cfg["points_capable"]}

# color lights only
if self.modelid in ["LST002", "LCT001", "LCT015", "LCX002", "915005987201", "LCX004"]:
if self.modelid in ["LST002", "LCT001", "LCT015", "LCX002", "915005987201", "LCX004", "LCX006"]:
colorgamut = lightTypes[self.modelid]["v1_static"]["capabilities"]["control"]["colorgamut"]
result["color"] = {
"gamut": {
Expand Down Expand Up @@ -594,7 +595,7 @@ def getV2Entertainment(self):
"length": 2,
"start": 18
}]
elif self.modelid in ["915005987201", "LCX004"]:
elif self.modelid in ["915005987201", "LCX004", "LCX006"]:
result["segments"]["max_segments"] = 10
result["segments"]["segments"] = [
{
Expand Down Expand Up @@ -629,11 +630,11 @@ def dynamicScenePlay(self, palette, index):
while self.dynamics["status"] == "dynamic_palette":
transition = int(30 / self.dynamics["speed"])
logging.debug("using transistiontime " + str(transition))
if self.modelid in ["LCT001", "LCT015", "LST002", "LCX002", "915005987201", "LCX004"]:
if self.modelid in ["LCT001", "LCT015", "LST002", "LCX002", "915005987201", "LCX004", "LCX006"]:
if index == len(palette["color"]):
index = 0
points = []
if self.modelid in ["LCX002", "915005987201", "LCX004"]:
if self.modelid in ["LCX002", "915005987201", "LCX004", "LCX006"]:
gradientIndex = index
# for gradient lights
for x in range(self.protocol_cfg["points_capable"]):
Expand Down Expand Up @@ -851,7 +852,7 @@ def getV2Api(self):
gradientStrip = False
if light().modelid in ["LCX001", "LCX002", "LCX003"]:
loops = len(gradienStripPositions)
elif light().modelid in ["915005987201", "LCX004"]:
elif light().modelid in ["915005987201", "LCX004", "LCX006"]:
loops = 3
for x in range(loops):
channel = {
Expand All @@ -869,7 +870,7 @@ def getV2Api(self):
if light().modelid in ["LCX001", "LCX002", "LCX003"]:
channel["position"] = {"x": gradienStripPositions[x]["x"],
"y": gradienStripPositions[x]["y"], "z": gradienStripPositions[x]["z"]}
elif light().modelid in ["915005987201", "LCX004"]:
elif light().modelid in ["915005987201", "LCX004", "LCX006"]:
if x == 0:
channel["position"] = {"x": self.locations[light(
)][0]["x"], "y": self.locations[light()][0]["y"], "z": self.locations[light()][0]["z"]}
Expand Down
10 changes: 10 additions & 0 deletions BridgeEmulator/lights/light_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@
lightTypes["LCX004"]["config"] = {"archetype": "huelightstrip", "function": "mixed", "direction": "omnidirectional","startup": {"mode": "safety","configured": False}}
lightTypes["LCX004"]["dynamics"] = {"speed": 0, "speed_valid": False, "status": "none", "status_values": ["none", "dynamic_palette"]}

## Hue Play Lightstrip
lightTypes["LCX006"] = {"v1_static": {"type": "Extended color light", "manufacturername": "Signify Netherlands B.V.", "productname": "Hue gradient lightstrip","swversion": "1.94.2","swconfigid": "DC0A18AF","productid": "4422-9482-0441_HG01_PSU03"}}
lightTypes["LCX006"]["v1_static"]["swupdate"] = {"state": "noupdates","lastinstall": "2022-01-13T22:54:51"}
lightTypes["LCX006"]["v1_static"]["capabilities"] = {"certified": True,"control": {"mindimlevel": 100,"maxlumen": 1600,"colorgamuttype": "C","colorgamut": [[0.6915,0.3083],[0.1700,0.7000],[0.1532,0.0475]],"ct": {"min": 153,"max": 500}},"streaming": {"renderer": True,"proxy": True}}
lightTypes["LCX006"]["device"] = {"certified": True,"hardware_platform_type": "100b-118","manufacturer_name": "Signify Netherlands B.V.","model_id": "LCX004","product_archetype": "hue_lightstrip","product_name": "Hue gradient lightstrip","software_version": "1.94.2"}
lightTypes["LCX006"]["state"] = {"on": False, "bri": 254,"hue": 8417,"sat": 140,"effect": "none","xy": [0.0,0.0],"ct": 366,"alert": "select","colormode": "ct","mode": "homeautomation","reachable": True, "gradient": {"points": []}}
lightTypes["LCX006"]["config"] = {"archetype": "huelightstrip", "function": "mixed", "direction": "omnidirectional","startup": {"mode": "safety","configured": False}}
lightTypes["LCX006"]["dynamics"] = {"speed": 0, "speed_valid": False, "status": "none", "status_values": ["none", "dynamic_palette"]}


## Hue Plug
lightTypes["LOM001"] = {"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["LOM001"]["v1_static"]["swupdate"] = {"state": "noupdates","lastinstall": "2020-12-09T19:13:52"}
Expand Down

0 comments on commit 5249384

Please sign in to comment.