Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for LCX006 #937

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 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 @@ -867,9 +868,10 @@ 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
9 changes: 9 additions & 0 deletions BridgeEmulator/lights/light_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@
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 Gradient Lightstrip for PC
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
2 changes: 2 additions & 0 deletions BridgeEmulator/sensors/sensor_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
sensorTypes["TRADFRI remote control"] = {"ZHASwitch": {"state": {"buttonevent": 1002, "lastupdated": "none"}, "config": {"alert": "none", "battery": 90, "on": True, "reachable": True}, "static": {"swversion": "1.2.214", "manufacturername": "IKEA of Sweden"}}}
sensorTypes["TRADFRI on/off switch"] = {"ZHASwitch": {"state": {"buttonevent": 1002, "lastupdated": "none"}, "config": {"alert": "none", "battery": 90, "on": True, "reachable": True}, "static": {"swversion": "2.2.008", "manufacturername": "IKEA of Sweden"}}}
sensorTypes["TRADFRI wireless dimmer"] = {"ZHASwitch": {"state": {"buttonevent": 1002, "lastupdated": "none"}, "config": {"alert": "none", "battery": 90, "on": True, "reachable": True}, "static": {"swversion": "1.2.248", "manufacturername": "IKEA of Sweden"}}}

# Fix Deconz types
sensorTypes["RWL022"]["ZHASwitch"] = sensorTypes["RWL022"]["ZLLSwitch"]
sensorTypes["SML001"]["ZHATemperature"] = sensorTypes["SML001"]["ZLLTemperature"]
sensorTypes["SML001"]["ZHAPresence"] = sensorTypes["SML001"]["ZLLPresence"]
sensorTypes["SML001"]["ZHALightLevel"] = sensorTypes["SML001"]["ZLLLightLevel"]

Loading
Loading