Skip to content

Commit

Permalink
Merge pull request #83 from network-guy/main
Browse files Browse the repository at this point in the history
Update capabilities to include 6" full-color downlights
  • Loading branch information
nikshriv committed Jun 21, 2024
2 parents 7a24685 + 135b81b commit f4923bf
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions custom_components/cync_lights/cync_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
API_DEVICE_INFO = "https://api.gelighting.com/v2/product/{product_id}/device/{device_id}/property"

Capabilities = {
"ONOFF":[1,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,48,49,51,52,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,80,81,82,83,85,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,156,158,159,160,161,162,163,164,165],
"BRIGHTNESS":[1,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,48,49,55,56,80,81,82,83,85,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,156,158,159,160,161,162,163,164,165],
"COLORTEMP":[5,6,7,8,10,11,14,15,19,20,21,22,23,25,26,28,29,30,31,32,33,34,35,80,82,83,85,129,130,131,132,133,135,136,137,138,139,140,141,142,143,144,145,146,147,153,154,156,158,159,160,161,162,163,164,165],
"RGB":[6,7,8,21,22,23,30,31,32,33,34,35,131,132,133,137,138,139,140,141,142,143,146,147,153,154,156,158,159,160,161,162,163,164,165],
"ONOFF":[1,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,48,49,51,52,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,80,81,82,83,85,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,156,158,159,160,161,162,163,164,165,169,170],
"BRIGHTNESS":[1,5,6,7,8,9,10,11,13,14,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,48,49,55,56,80,81,82,83,85,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,156,158,159,160,161,162,163,164,165,169,170],
"COLORTEMP":[5,6,7,8,10,11,14,15,19,20,21,22,23,25,26,28,29,30,31,32,33,34,35,80,82,83,85,129,130,131,132,133,135,136,137,138,139,140,141,142,143,144,145,146,147,153,154,156,158,159,160,161,162,163,164,165,169,170],
"RGB":[6,7,8,21,22,23,30,31,32,33,34,35,131,132,133,137,138,139,140,141,142,143,146,147,153,154,156,158,159,160,161,162,163,164,165,169,170],
"MOTION":[37,49,54],
"AMBIENT_LIGHT":[37,49,54],
"WIFICONTROL":[36,37,38,39,40,48,49,51,52,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,80,81,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,156,158,159,160,161,162,163,164,165],
"WIFICONTROL":[36,37,38,39,40,48,49,51,52,53,54,55,56,57,58,59,61,62,63,64,65,66,67,68,80,81,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,156,158,159,160,161,162,163,164,165,169,170],
"PLUG":[64,65,66,67,68],
"FAN":[81],
"MULTIELEMENT":{'67':2}
Expand Down Expand Up @@ -417,6 +417,7 @@ async def turn_on(self, attr_rgb, attr_br, attr_ct) -> None:
self.hub.combo_control(True, self.brightness, 254, attr_rgb, controller, self.mesh_id, seq)
elif attr_ct is not None:
ct = round(100*(self.max_mireds - attr_ct)/(self.max_mireds - self.min_mireds))
self.hub.turn_on(controller, self.mesh_id, seq)
self.hub.set_color_temp(ct, controller, self.mesh_id, seq)
else:
self.hub.turn_on(controller, self.mesh_id, seq)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/cync_lights/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ async def async_set_percentage(self, percentage: int) -> None:
if percentage == 0:
await self.async_turn_off()
else:
await self.cync_switch.turn_on(None,percentage*255/100,None)
await self.cync_switch.turn_on(None,percentage*255/100,None)
2 changes: 1 addition & 1 deletion custom_components/cync_lights/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,4 @@ async def async_turn_on(self, **kwargs: Any) -> None:

async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn off the light."""
await self.cync_switch.turn_off()
await self.cync_switch.turn_off()
2 changes: 1 addition & 1 deletion custom_components/cync_lights/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@ async def async_turn_on(self, **kwargs: Any) -> None:

async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn off the outlet."""
await self.cync_switch.turn_off()
await self.cync_switch.turn_off()
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Cync Lights Custom Integration",
"name": "Cync Lights Custom Integration (Forked)",
"domains": ["light"],
"render_readme": true
}

0 comments on commit f4923bf

Please sign in to comment.