Move to poetry

This commit is contained in:
Andrea Mistrali 2023-12-11 12:31:07 +01:00
parent 2e149a730a
commit 5a2ad122f5
Signed by: andre
SSH Key Fingerprint: SHA256:/D780pZnuHMQ8xFII5lAtXWy8zdowtBhgWjwi88p+lI
4 changed files with 46 additions and 9 deletions

16
poetry.lock generated Normal file
View File

@ -0,0 +1,16 @@
# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand.
[[package]]
name = "docopt"
version = "0.6.2"
description = "Pythonic argument parser, that will make you smile"
optional = false
python-versions = "*"
files = [
{file = "docopt-0.6.2.tar.gz", hash = "sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"},
]
[metadata]
lock-version = "2.0"
python-versions = "^3.11"
content-hash = "020d3e03335e70ca8b1cfd769838e50546a63b9ed4e4034ba584fd3a3ec497fd"

View File

@ -54,9 +54,21 @@ def value_linear(obj, step):
return delta * (100-step)/50 + obj.min return delta * (100-step)/50 + obj.min
def value_vshape(obj, step):
"""
V-shape value, 1-0-1
"""
delta = obj.max - obj.min
if step < 50:
return delta * (100-step)/50 + obj.min
else:
return delta*step/50 + obj.min
def value_sin(obj, step): def value_sin(obj, step):
""" """
Sinusoidal values, 0-1-0 /\ Sinusoidal values, 0-1-0
""" """
delta = obj.max - obj.min delta = obj.max - obj.min
@ -66,7 +78,7 @@ def value_sin(obj, step):
def value_cos(obj, step): def value_cos(obj, step):
""" """
Absolute Cosinusoidal values, 1-0-1 \\// Absolute Cosinusoidal values, 1-0-1
""" """
delta = obj.max - obj.min delta = obj.max - obj.min

View File

@ -10,7 +10,7 @@ from .methods import * # NOQA
class ledPulse(threading.Thread): class ledPulse(threading.Thread):
delayMethods = ['constant', 'sin', 'cos'] delayMethods = ['constant', 'sin', 'cos']
valueMethods = ['on', 'off', 'linear', 'sin', 'cos'] valueMethods = ['on', 'off', 'linear', 'vshape', 'sin', 'cos']
methods = {'delay': {}, 'value': {}} methods = {'delay': {}, 'value': {}}
defaultSet = { defaultSet = {
@ -69,7 +69,7 @@ class ledPulse(threading.Thread):
self.model = sys.platform self.model = sys.platform
try: try:
with open('/sys/firmware/devicetree/base/model', 'r') as m: with open('/sys/firmware/devicetree/base/model', 'r') as m:
model = m.read() model = m.read().strip()
if model.lower().startswith('raspberry pi'): if model.lower().startswith('raspberry pi'):
self.supported = True self.supported = True
self.model = model self.model = model

View File

@ -1,6 +1,15 @@
[build-system] [tool.poetry]
requires = ["setuptools", "wheel"] name = "pulses"
build-backend = "setuptools.build_meta" version = "0.90"
description = "Pulse LEDs on RPi"
authors = ["Andrea Mistrali <andrea@mistrali.pw>"]
readme = "README.md"
[tool.pyright] [tool.poetry.dependencies]
reportMissingImports = "information" python = "^3.11"
docopt = "^0.6.2"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"