Add deinit method to modules and extensions

This commit is contained in:
xs5871
2023-03-09 20:51:38 +00:00
committed by xs5871
parent 55b3a3a9b1
commit adff02e88a
4 changed files with 25 additions and 0 deletions

View File

@@ -49,3 +49,6 @@ class Extension:
def on_powersave_disable(self, keyboard):
raise NotImplementedError
def deinit(self, keyboard):
pass

View File

@@ -249,6 +249,10 @@ class RGB(Extension):
def on_powersave_disable(self, sandbox):
self._do_update()
def deinit(self, sandbox):
for pixel in self.pixels:
pixel.deinit()
def set_hsv(self, hue, sat, val, index):
'''
Takes HSV values and displays it on a single LED/Neopixel