Format code with Black

parent 5d93aa1e
......@@ -30,9 +30,7 @@ class IPCManager:
self.poller = None
def send(self, topic: Topic, body: Dict):
self.pub.send_multipart(
[topic.name.encode(), json.dumps(body).encode()]
)
self.pub.send_multipart([topic.name.encode(), json.dumps(body).encode()])
def recv(self, block=True) -> Tuple[Topic, Dict]:
if not self.subs:
......
......@@ -14,9 +14,7 @@ class AnalogConverter:
An MCP3008 analog to digital converter.
"""
def __init__(
self, pi: pigpio.pi, channel: int, baud_rate: int, voltage: float
):
def __init__(self, pi: pigpio.pi, channel: int, baud_rate: int, voltage: float):
"""
Instantiate a new ADC connected to the Pi.
......
......@@ -9,9 +9,7 @@ class Servo:
A continuous servo that moves between 0 and 180 degrees.
"""
def __init__(
self, pi: pigpio.pi, gpio_pin: int, min_width: int, max_width: int
):
def __init__(self, pi: pigpio.pi, gpio_pin: int, min_width: int, max_width: int):
"""
Instantiate a new servo connected to the Pi on the given GPIO pin.
......@@ -42,7 +40,5 @@ class Servo:
if angle < 0 or angle > 180:
raise ValueError("The angle must be between 0 and 180 degrees.")
width = (angle / 180) * (
self.max_width - self.min_width
) + self.min_width
width = (angle / 180) * (self.max_width - self.min_width) + self.min_width
self.pi.set_servo_pulsewidth(self.gpio_pin, width)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment