Skip to content

Commit

Permalink
Add local endpoint for device/rgb
Browse files Browse the repository at this point in the history
This closes #229
  • Loading branch information
AdamaTheHutt committed Jun 11, 2019
1 parent dc2a1e7 commit f128fe9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions telldus/src/telldus/DeviceApiManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ def deviceLearn(self, id, **kwargs): # pylint: disable=C0103,W0622
"""
return self.deviceCommand(id, Device.LEARN, **kwargs)

@apicall('device', 'rgb')
def deviceRGB(self, id, r, g, b, **kwargs):
"""
Send a command to change color on a device
"""
r = (int(r) & 0xFF) << 16;
g = (int(g) & 0xFF) << 8;
b = int(b) & 0xFF;
color = r | g | b;
return self.deviceCommand(id, Device.RGB, color)

@apicall('device', 'setName')
def deviceSetName(self, id, name, **__kwargs): # pylint: disable=C0103,W0622
"""
Expand Down

0 comments on commit f128fe9

Please sign in to comment.