mirror of
https://github.com/undera/pylgbst.git
synced 2020-11-18 19:37:26 -08:00
Enable subscribing to LED notifications
This commit is contained in:
parent
0a4227d132
commit
6a49f5c840
@ -232,6 +232,12 @@ class LEDRGB(Peripheral):
|
|||||||
msg = MsgPortOutput(self.port, MsgPortOutput.WRITE_DIRECT_MODE_DATA, payload)
|
msg = MsgPortOutput(self.port, MsgPortOutput.WRITE_DIRECT_MODE_DATA, payload)
|
||||||
self._send_output(msg)
|
self._send_output(msg)
|
||||||
|
|
||||||
|
def _decode_port_data(self, msg):
|
||||||
|
if len(msg.payload) == 3:
|
||||||
|
return usbyte(msg.payload, 0), usbyte(msg.payload, 1), usbyte(msg.payload, 2),
|
||||||
|
else:
|
||||||
|
return usbyte(msg.payload, 0),
|
||||||
|
|
||||||
|
|
||||||
class Motor(Peripheral):
|
class Motor(Peripheral):
|
||||||
SUBCMD_START_POWER = 0x01
|
SUBCMD_START_POWER = 0x01
|
||||||
|
Loading…
x
Reference in New Issue
Block a user