1
0
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:
Andrey Pokhilko 2019-12-27 22:18:51 +03:00
parent 0a4227d132
commit 6a49f5c840

View File

@ -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