From b01e97c1bb2dd2e0eda77deb43de47320f76ccc3 Mon Sep 17 00:00:00 2001 From: Jeroen Harkes Date: Wed, 15 Nov 2023 21:28:28 +0100 Subject: [PATCH 1/2] #913 fix statusled extension variable name typo --- kmk/extensions/statusled.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/kmk/extensions/statusled.py b/kmk/extensions/statusled.py index fa5e7936e..1043ace4e 100644 --- a/kmk/extensions/statusled.py +++ b/kmk/extensions/statusled.py @@ -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) @@ -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() From a79605abadf1f55a4cce29b5f8d48279f2aa5d04 Mon Sep 17 00:00:00 2001 From: Jeroen Harkes Date: Sun, 19 Nov 2023 00:25:08 +0100 Subject: [PATCH 2/2] #913 fix statusled extension variable name typo - attempt 2 --- kmk/extensions/statusled.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmk/extensions/statusled.py b/kmk/extensions/statusled.py index 1043ace4e..3e56f5aef 100644 --- a/kmk/extensions/statusled.py +++ b/kmk/extensions/statusled.py @@ -61,7 +61,7 @@ def __repr__(self): def _to_dict(self): return { - '_brightness': self.brightness, + 'brightness': self.brightness, 'brightness_step': self.brightness_step, 'brightness_limit': self.brightness_limit, }