Executable added

This commit is contained in:
2022-06-25 17:51:04 +02:00
parent 80bce11258
commit ff4ed23325
6 changed files with 8 additions and 5 deletions

View File

@@ -4,6 +4,9 @@ version = "0.1.0"
description = ""
authors = ["Marijn Doeve <marijn@doeve.me>"]
[tool.poetry.scripts]
projectorpi = "projectorpi.cli:main"
[tool.poetry.dependencies]
python = "^3.9"
pyserial = "^3.5"

View File

View File

@@ -1,12 +1,12 @@
#! /usr/bin/env python3
from argparse import ArgumentParser
from projector import ProjectorSerial
from extron import ExtronSerial
from .projector import ProjectorSerial
from .extron import ExtronSerial
verbose = False
if __name__ == "__main__":
def main():
parser = ArgumentParser(
prog="projectorpi", description="A tool that turns the projector on and off."
)

View File

@@ -2,7 +2,7 @@
# | == carriage return
from types import LambdaType
from typing import Callable
from serialdevice import SerialDevice
from .serialdevice import SerialDevice
# \x1b == ESC
C: Callable[[str], str] = lambda command: f"\x1b{command}\r"

View File

@@ -1,4 +1,4 @@
from serialdevice import SerialDevice
from .serialdevice import SerialDevice
STX = chr(0x02)
ETX = chr(0x03)