A wild W504 linter error appeared! Fix those.

This commit is contained in:
Josh Klar 2019-07-20 15:15:01 -07:00
parent 5c8bd45615
commit a51d11f6e6
No known key found for this signature in database
GPG Key ID: A4A0C7B4E8EEE222
5 changed files with 17 additions and 16 deletions

View File

@ -101,10 +101,8 @@ def tt_pressed(key, state, *args, **kwargs):
def tt_released(key, state, *args, **kwargs):
if (
state.start_time['tt'] is None or
ticks_diff(ticks_ms(), state.start_time['tt']) >= state.config.tap_time
):
tap_timed_out = ticks_diff(ticks_ms(), state.start_time['tt']) >= state.config.tap_time
if state.start_time['tt'] is None or tap_timed_out:
# On first press, works like MO. On second press, does nothing unless let up within
# time window, then acts like TG.
state.start_time['tt'] = None

View File

@ -183,10 +183,7 @@ else:
self.devices[HIDReportTypes.MOUSE] = device
continue
if (
up == HIDUsagePage.SYSCONTROL and
us == HIDUsage.SYSCONTROL
):
if up == HIDUsagePage.SYSCONTROL and us == HIDUsage.SYSCONTROL:
self.devices[HIDReportTypes.SYSCONTROL] = device
continue

View File

@ -200,10 +200,10 @@ class InternalState:
if changed_key not in self.tap_side_effects:
self.tap_side_effects[changed_key] = None
else:
if (
self.tap_side_effects[changed_key] is not None or
self.tap_dance_counts[changed_key] == len(changed_key.codes)
):
has_side_effects = self.tap_side_effects[changed_key] is not None
hit_max_defined_taps = self.tap_dance_counts[changed_key] == len(changed_key.codes)
if has_side_effects or hit_max_defined_taps:
self._end_tap_dance(changed_key)
return self

View File

@ -110,8 +110,11 @@ class led:
def effect_breathing(self):
# http://sean.voisen.org/blog/2011/10/breathing-led-with-arduino/
# https://github.com/qmk/qmk_firmware/blob/9f1d781fcb7129a07e671a46461e501e3f1ae59d/quantum/rgblight.c#L806
self.brightness = int((exp(sin((self.pos / 255.0) * pi)) - self.breathe_center / e) *
(self.brightness_limit / (e - 1 / e)))
sined = sin((self.pos / 255.0) * pi)
multip_1 = exp(sined) - self.breathe_center / e
multip_2 = self.brightness_limit / (e - 1 / e)
self.brightness = int(multip_1 * multip_2)
self.pos = (self.pos + self.animation_speed) % 256
self.set_brightness(self.brightness)

View File

@ -424,8 +424,11 @@ class RGB:
def effect_breathing(self):
# http://sean.voisen.org/blog/2011/10/breathing-led-with-arduino/
# https://github.com/qmk/qmk_firmware/blob/9f1d781fcb7129a07e671a46461e501e3f1ae59d/quantum/rgblight.c#L806
self.val = int((exp(sin((self.pos / 255.0) * pi)) - self.breathe_center / e) *
(self.val_limit / (e - 1 / e)))
sined = sin((self.pos / 255.0) * pi)
multip_1 = exp(sined) - self.breathe_center / e
multip_2 = self.val_limit / (e - 1 / e)
self.val = int(multip_1 * multip_2)
self.pos = (self.pos + self.animation_speed) % 256
self.set_hsv_fill(self.hue, self.sat, self.val)