fix formatting, run test

This commit is contained in:
Rene Giovanni Borella authored and Kyle Brown committed 2022-02-19 21:33:45 -08:00
1 parent 2096f1a950
commit fb783c302c
1 file changed
+6 -2
+6 -2
View File
@@ -107,6 +107,7 @@ class GPIOEncoder(BaseEncoder):
)
self._state = (self.pin_a.get_value(), self.pin_b.get_value())
def button_event(self):
if self.pin_button:
new_button_state = self.pin_button.get_value()
@@ -115,6 +116,7 @@ class GPIOEncoder(BaseEncoder):
if self.on_button_do is not None:
self.on_button_do(self.get_state())
class EncoderPin:
def __init__(self, pin, button_type=False):
self.pin = pin
@@ -232,8 +234,10 @@ class EncoderHandler(Module):
new_encoder.on_move_do = lambda x, bound_idx=idx: self.on_move_do(
keyboard, bound_idx, x
)
new_encoder.on_button_do = lambda x, bound_idx=idx: self.on_button_do(
keyboard, bound_idx, x
new_encoder.on_button_do = (
lambda x, bound_idx=idx: self.on_button_do(
keyboard, bound_idx, x
)
)
self.encoders.append(new_encoder)
except Exception as e: