def updateUI(self, data):
size = len(data) / 3
if size != self._count:
log.warning("Bytecount mismatch")
return
for i in range(size):
r = data[i * 3 + 0]
g = data[i * 3 + 1]
b = data[i * 3 + 2]
self._values[i] = self.toHexColor(r, g, b)
try:
for i in range(self._count):
self._canvas.itemconfig(self._leds[i], fill=self._values[i])
except TclError:
# Looks like the UI closed!
pass
评论列表
文章目录