Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
d63ed10d44
|
|||
|
a53ab8e209
|
|||
|
f69939f783
|
|||
|
ce1d881c84
|
|||
|
0cb91e268d
|
|||
|
2ece5d2bee
|
|||
| 24ef94cce9 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
.vscode/
|
||||||
### Generated by gibo (https://github.com/simonwhitaker/gibo)
|
### Generated by gibo (https://github.com/simonwhitaker/gibo)
|
||||||
### https://raw.github.com/github/gitignore/e5323759e387ba347a9d50f8b0ddd16502eb71d4/Python.gitignore
|
### https://raw.github.com/github/gitignore/e5323759e387ba347a9d50f8b0ddd16502eb71d4/Python.gitignore
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,21 @@
|
|||||||
# See https://pre-commit.com for more information
|
# See https://pre-commit.com for more information
|
||||||
# See https://pre-commit.com/hooks.html for more hooks
|
# See https://pre-commit.com/hooks.html for more hooks
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.3.0
|
rev: v3.2.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
- id: check-toml
|
- id: check-added-large-files
|
||||||
- id: check-added-large-files
|
- repo: https://github.com/python-poetry/poetry
|
||||||
- repo: https://github.com/psf/black
|
rev: 1.4.0 # add version here
|
||||||
rev: 22.3.0
|
hooks:
|
||||||
hooks:
|
- id: poetry-check
|
||||||
- id: black
|
- id: poetry-lock
|
||||||
language_version: python3.9
|
- id: poetry-export
|
||||||
- repo: https://github.com/python-poetry/poetry
|
args: ["-f", "requirements.txt", "-o", "requirements.txt"]
|
||||||
rev: 1.2.0b2
|
- repo: https://github.com/psf/black
|
||||||
hooks:
|
rev: 23.1.0
|
||||||
- id: poetry-check
|
hooks:
|
||||||
- id: poetry-lock
|
- id: black
|
||||||
- id: poetry-export
|
|
||||||
args: ["-f", "requirements.txt", "-o", "requirements.txt"]
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
[](https://drone.marijndoeve.nl/Marijn/ProjectorPi)
|
||||||
|
|
||||||
# ProjectorPi
|
# ProjectorPi
|
||||||
|
|
||||||
Projector is a personal tool I user to control my _Panasonic PT-RW330_ projector and _Extron IN1604 DTP_ scalar over serial using a Raspberry Pi.
|
Projector is a personal tool I user to control my _Panasonic PT-RW330_ projector and _Extron IN1604 DTP_ scalar over serial using a Raspberry Pi.
|
||||||
|
|||||||
1516
poetry.lock
generated
1516
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "ProjectorPi"
|
name = "ProjectorPi"
|
||||||
version = "0.1.2"
|
version = "0.3.0"
|
||||||
description = ""
|
description = ""
|
||||||
authors = ["Marijn Doeve <marijn@doeve.me>"]
|
authors = ["Marijn Doeve <marijn@doeve.me>"]
|
||||||
license = "GPL-3.0-or-later"
|
license = "GPL-3.0-or-later"
|
||||||
@@ -11,6 +11,7 @@ projectorpi = "projectorpi.cli:main"
|
|||||||
[tool.poetry.dependencies]
|
[tool.poetry.dependencies]
|
||||||
python = "^3.9"
|
python = "^3.9"
|
||||||
pyserial = "^3.5"
|
pyserial = "^3.5"
|
||||||
|
sentry-sdk = "^1.25.0"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.poetry.dev-dependencies]
|
||||||
black = "*"
|
black = "*"
|
||||||
|
|||||||
@@ -1,3 +1,12 @@
|
|||||||
|
certifi==2023.5.7 ; python_version >= "3.9" and python_version < "4.0" \
|
||||||
|
--hash=sha256:0f0d56dc5a6ad56fd4ba36484d6cc34451e1c6548c61daad8c320169f91eddc7 \
|
||||||
|
--hash=sha256:c6c2e98f5c7869efca1f8916fed228dd91539f9f1b444c314c06eef02980c716
|
||||||
pyserial==3.5 ; python_version >= "3.9" and python_version < "4.0" \
|
pyserial==3.5 ; python_version >= "3.9" and python_version < "4.0" \
|
||||||
--hash=sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb \
|
--hash=sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb \
|
||||||
--hash=sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0
|
--hash=sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0
|
||||||
|
sentry-sdk==1.25.0 ; python_version >= "3.9" and python_version < "4.0" \
|
||||||
|
--hash=sha256:5be3296fc574fa8a4d9b213b4dcf8c8d0246c08f8bd78315c6286f386c37555a \
|
||||||
|
--hash=sha256:fe85cf5d0b3d0aa3480df689f9f6dc487de783defb0a95043368375dc893645e
|
||||||
|
urllib3==2.0.2 ; python_version >= "3.9" and python_version < "4.0" \
|
||||||
|
--hash=sha256:61717a1095d7e155cdb737ac7bb2f4324a858a1e2e6466f6d03ff630ca68d3cc \
|
||||||
|
--hash=sha256:d055c2f9d38dc53c808f6fdc8eab7360b6fdbbde02340ed25cfbcd817c62469e
|
||||||
|
|||||||
@@ -5,6 +5,16 @@ from time import sleep
|
|||||||
from .projector import ProjectorSerial
|
from .projector import ProjectorSerial
|
||||||
from .extron import ExtronSerial
|
from .extron import ExtronSerial
|
||||||
|
|
||||||
|
import sentry_sdk
|
||||||
|
|
||||||
|
sentry_sdk.init(
|
||||||
|
dsn="https://4a9c016c11074639a16778c78709e402@sentry.marijndoeve.nl/2",
|
||||||
|
# Set traces_sample_rate to 1.0 to capture 100%
|
||||||
|
# of transactions for performance monitoring.
|
||||||
|
# We recommend adjusting this value in production.
|
||||||
|
traces_sample_rate=1.0,
|
||||||
|
)
|
||||||
|
|
||||||
verbose = False
|
verbose = False
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ class ExtronSerial(SerialDevice):
|
|||||||
|
|
||||||
return response
|
return response
|
||||||
|
|
||||||
def check_sleep(self) -> str:
|
def _check_sleep(self) -> str:
|
||||||
return self.send_command(C("PSAV"))
|
return self.send_command(C("PSAV"))
|
||||||
|
|
||||||
def sleep(self) -> None:
|
def sleep(self) -> None:
|
||||||
@@ -59,7 +59,7 @@ class ExtronSerial(SerialDevice):
|
|||||||
self.send_command(f"{input}!")
|
self.send_command(f"{input}!")
|
||||||
|
|
||||||
def is_sleeping(self) -> bool:
|
def is_sleeping(self) -> bool:
|
||||||
response = self.check_sleep
|
response = self._check_sleep()
|
||||||
|
|
||||||
return bool(int(response))
|
return bool(int(response))
|
||||||
|
|
||||||
|
|||||||
@@ -25,3 +25,6 @@ class ProjectorSerial(SerialDevice):
|
|||||||
|
|
||||||
def power_off(self) -> None:
|
def power_off(self) -> None:
|
||||||
self.send_command("POF")
|
self.send_command("POF")
|
||||||
|
|
||||||
|
def is_on(self) -> bool:
|
||||||
|
return self.send_command("QPW") == "001"
|
||||||
|
|||||||
0
src/projectorpi/py.typed
Normal file
0
src/projectorpi/py.typed
Normal file
@@ -12,7 +12,6 @@ class SerialDevice:
|
|||||||
self.prefix = ""
|
self.prefix = ""
|
||||||
|
|
||||||
def send_command(self, command: str) -> str:
|
def send_command(self, command: str) -> str:
|
||||||
|
|
||||||
with Serial(self.serial_port, self.baudrate, timeout=3) as s:
|
with Serial(self.serial_port, self.baudrate, timeout=3) as s:
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
print(self.prefix, "send:", command)
|
print(self.prefix, "send:", command)
|
||||||
|
|||||||
Reference in New Issue
Block a user