Push patterns in to the state events properly

master
Ryan Rix 7 years ago
parent 2b718f29c3
commit 595a9919e4

@ -37,11 +37,10 @@ class Lightrix:
for led_idx in range(0, self.strip.count()):
color = pattern(led_idx, msg)
self.strip.setPixelRgb(led_idx, color[0], color[1], color[2])
self.strip.show()
for room_id in self.matrix.room_ids:
self.matrix.client.api.send_state_event(
room_id, "m.lightrix.pattern",
{"pattern": str(pattern), "from_msg": msg}
{"pattern": self.strip.show(), "from_msg": msg}
)

@ -33,4 +33,6 @@ class Strip(object):
def show(self):
self.strip.show()
return [ self.strip.getPixelColor(ix)
for ix in range(self.led_count) ]

Loading…
Cancel
Save