fix: LED static mode toggling (#673)
* Fix bug with static mode toggling Previously, animation mode was set to none, which prevented the leds from being toggled. Now uses STATIC_STANDBY * fix formatting
This commit is contained in:
parent
a309aa52f3
commit
dd61c3705b
@ -124,9 +124,7 @@ class LED(Extension):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def after_hid_send(self, sandbox):
|
def after_hid_send(self, sandbox):
|
||||||
if self._enabled and self.animation_mode:
|
|
||||||
self.animate()
|
self.animate()
|
||||||
return
|
|
||||||
|
|
||||||
def on_powersave_enable(self, sandbox):
|
def on_powersave_enable(self, sandbox):
|
||||||
return
|
return
|
||||||
@ -196,8 +194,8 @@ class LED(Extension):
|
|||||||
|
|
||||||
def effect_static(self):
|
def effect_static(self):
|
||||||
self.set_brightness(self._brightness)
|
self.set_brightness(self._brightness)
|
||||||
# Set animation mode to none to prevent cycles from being wasted
|
# Set animation mode to standby to prevent cycles from being wasted
|
||||||
self.animation_mode = None
|
self.animation_mode = AnimationModes.STATIC_STANDBY
|
||||||
|
|
||||||
def animate(self):
|
def animate(self):
|
||||||
'''
|
'''
|
||||||
@ -211,6 +209,8 @@ class LED(Extension):
|
|||||||
return self.effect_breathing()
|
return self.effect_breathing()
|
||||||
elif self.animation_mode == AnimationModes.STATIC:
|
elif self.animation_mode == AnimationModes.STATIC:
|
||||||
return self.effect_static()
|
return self.effect_static()
|
||||||
|
elif self.animation_mode == AnimationModes.STATIC_STANDBY:
|
||||||
|
pass
|
||||||
elif self.animation_mode == AnimationModes.USER:
|
elif self.animation_mode == AnimationModes.USER:
|
||||||
return self.user_animation(self)
|
return self.user_animation(self)
|
||||||
else:
|
else:
|
||||||
@ -231,6 +231,8 @@ class LED(Extension):
|
|||||||
if self.animation_mode == AnimationModes.STATIC_STANDBY:
|
if self.animation_mode == AnimationModes.STATIC_STANDBY:
|
||||||
self.animation_mode = AnimationModes.STATIC
|
self.animation_mode = AnimationModes.STATIC
|
||||||
|
|
||||||
|
if self._enabled:
|
||||||
|
self.off()
|
||||||
self._enabled = not self._enabled
|
self._enabled = not self._enabled
|
||||||
|
|
||||||
def _key_led_inc(self, key, *args, **kwargs):
|
def _key_led_inc(self, key, *args, **kwargs):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user