Fill buffer with RGB data. All LEDs after the data are turned off.
(self, data)
| 136 | return index // 12 |
| 137 | |
| 138 | def fill_buf(self, data): |
| 139 | """ |
| 140 | Fill buffer with RGB data. |
| 141 | |
| 142 | All LEDs after the data are turned off. |
| 143 | """ |
| 144 | end = self.update_buf(data) |
| 145 | |
| 146 | # turn off the rest of the LEDs |
| 147 | buf = self.buf |
| 148 | off = self.buf_bytes[0] |
| 149 | for index in range(end * 12, self.buf_length): |
| 150 | buf[index] = off |
| 151 | index += 1 |