Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#913 fix statusled extension variable name typo #914

Merged
merged 3 commits into from
Nov 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions kmk/extensions/statusled.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def on_powersave_enable(self, sandbox):
return

def on_powersave_disable(self, sandbox):
self.set_brightness(self._brightness)
self.set_brightness(self.brightness)
self._leds[2].duty_cycle = int(50 / 100 * 65535)
time.sleep(0.2)
self._leds[2].duty_cycle = int(0)
Expand All @@ -118,25 +118,25 @@ def set_brightness(self, percent, layer_id=-1):

def increase_brightness(self, step=None):
if not step:
self._brightness += self.brightness_step
self.brightness += self.brightness_step
else:
self._brightness += step
self.brightness += step

if self._brightness > 100:
self._brightness = 100
if self.brightness > 100:
self.brightness = 100

self.set_brightness(self._brightness, self._layer_last)
self.set_brightness(self.brightness, self._layer_last)

def decrease_brightness(self, step=None):
if not step:
self._brightness -= self.brightness_step
self.brightness -= self.brightness_step
else:
self._brightness -= step
self.brightness -= step

if self._brightness < 0:
self._brightness = 0
if self.brightness < 0:
self.brightness = 0

self.set_brightness(self._brightness, self._layer_last)
self.set_brightness(self.brightness, self._layer_last)

def _key_led_inc(self, *args, **kwargs):
self.increase_brightness()
Expand Down
Loading