Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: moodlamp.py
- ===================================================================
- --- moodlamp.py (revision 243)
- +++ moodlamp.py (working copy)
- @@ -72,6 +72,10 @@
- self.color = color
- self.interface.packet( self.address, "C%c%c%c" % (color[0], color[1], color[2]), 0, True)
- + def fadems(self, color, time):
- + self.color = color
- + self.interface.packet( self.address, "M%c%c%c%c" % (color[0], color[1], color[2], time), 0, True)
- +
- def pause(self, pause):
- self.interface.packet( self.address, "\x17", 0, True)
- #unused pause
- Index: mldclient.py
- ===================================================================
- --- mldclient.py (revision 243)
- +++ mldclient.py (working copy)
- @@ -112,7 +112,16 @@
- m = self.ml.getLamp(s[1])
- m.pause(True)
- elif cmd == "005": # unused
- - pass
- + if s[1] == "0":
- + for n in self.ml:
- + if n.ready:
- + self.push("Send %2d (%s) -> %s %s %s in %s\r\n" % (n.address, n.name, int(s[2], 16), int(s[3], 16), int(s[4], 16), int(s[5])))
- + m = self.ml.getLamp(n.address)
- + m.fadems([int(s[2], 16), int(s[3], 16), int(s[4], 16)], int(s[5]))
- + else:
- + m = self.ml.getLamp(s[1])
- + self.push("Send %2d (%s) -> %s %s %s in %s\r\n" % (m.address, m.name, int(s[2], 16), int(s[3], 16), int(s[4], 16), int(s[5])))
- + m.fadems([int(s[2], 16), int(s[3], 16), int(s[4], 16)], int(s[5]))
- elif cmd == "006": # set interface raw
- for m in self.interfaces:
- m.set_raw(True)
- @@ -184,7 +193,7 @@
- self.push("002 - list of all available and ready moodlamps\r\n")
- self.push("003 [moodlamp_id] <ff> <00> <00> - change color r/g/b as hex\r\n moodlamp id = 0 for all moodlamps\r\n")
- self.push("004 [moodlamp_id] - toggle pause\r\n")
- - self.push("005 - \r\n")
- + self.push("005 [moodlamp_id] <ff> <00> <00> <123> - fade to color r/g/b as hex in n minutes as dec \r\n moodlamp id = 0 for all moodlamps\r\n")
- self.push("006 - set interface raw \r\n")
- self.push("007 - flash firmware\r\n")
- self.push("008 - flash firmware\r\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement