Type hinting

This commit is contained in:
2022-06-05 15:35:36 +02:00
parent 8f9b7501ae
commit 74916a66d8
2 changed files with 6 additions and 4 deletions

View File

@@ -11,15 +11,17 @@ class ProjectorSerial(SerialDevice):
super().__init__(serial_port, baudrate)
def send_command(self, command: str, verbose: bool = False, device_id: str = "ZZ"):
def send_command(
self, command: str, verbose: bool = False, device_id: str = "ZZ"
) -> str:
assert device_id in ["01", "02", "03", "04", "05", "06", "ZZ"]
full_command = f"\x02AD{device_id};{command}\x03"
return super().send_command(full_command, verbose)
def power_on(self):
def power_on(self) -> None:
self.send_command("PON")
def power_off(self):
def power_off(self) -> None:
self.send_command("POF")