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()