memory improvements and fstring
This commit is contained in:
@@ -64,19 +64,7 @@ class LED(Extension):
|
||||
return 'LED({})'.format(self._to_dict())
|
||||
|
||||
def _to_dict(self):
|
||||
return (
|
||||
'LED('
|
||||
f'_brightness={self._brightness} '
|
||||
f'_pos={self._pos} '
|
||||
f'brightness_step={self.brightness_step} '
|
||||
f'brightness_limit={self.brightness_limit} '
|
||||
f'animation_mode={self.animation_mode} '
|
||||
f'animation_speed={self.animation_speed} '
|
||||
f'breathe_center={self.breathe_center} '
|
||||
f'val={self.val} '
|
||||
')'
|
||||
)
|
||||
pass
|
||||
return f'LED(_brightness={self._brightness} _pos={self._pos} brightness_step={self.brightness_step} brightness_limit={self.brightness_limit} animation_mode={self.animation_mode} animation_speed={self.animation_speed} breathe_center={self.breathe_center} val={self.val} )'
|
||||
|
||||
def _init_effect(self):
|
||||
self._pos = 0
|
||||
|
@@ -15,16 +15,7 @@ class Power(Extension):
|
||||
return f'Power({self._to_dict()})'
|
||||
|
||||
def _to_dict(self):
|
||||
return (
|
||||
'Power( '
|
||||
f'enable={self.enable} '
|
||||
f'powersave_pin={self.powersave_pin} '
|
||||
f'is_target={self.is_target} '
|
||||
f'_powersave_start={self._powersave_start} '
|
||||
f'_usb_last_scan={self._usb_last_scan} '
|
||||
f'_psp={self._psp} '
|
||||
')'
|
||||
)
|
||||
return f'Power( enable={self.enable} powersave_pin={self.powersave_pin} is_target={self.is_target} _powersave_start={self._powersave_start} _usb_last_scan={self._usb_last_scan} _psp={self._psp} )'
|
||||
|
||||
def during_bootup(self, keyboard):
|
||||
self.enable = not bool(self.usb_scan)
|
||||
|
Reference in New Issue
Block a user