feat: relay inversé, LED idle solid, luminosité manuelle, auto-flash lux
🚀 Deploy — JH Photomaton / 🔍 Vérification (push) Has been cancelled
🚀 Deploy — JH Photomaton / 🍓 Deploy sur le Pi (push) Has been cancelled

This commit is contained in:
2026-07-17 10:32:43 +02:00
parent 3de55821b7
commit 4b188ce819
8 changed files with 260 additions and 6 deletions
+20
View File
@@ -58,6 +58,7 @@ class LEDConfig:
pin: int = 18
count: int = 35
brightness: int = 180
auto_brightness: bool = False
freq_hz: int = 800000
dma: int = 10
strip_type: str = "WS2812"
@@ -140,6 +141,7 @@ class ConfigService:
pin=led_raw.get("pin", 18),
count=led_raw.get("count", 35),
brightness=led_raw.get("brightness", 180),
auto_brightness=led_raw.get("auto_brightness", False),
freq_hz=led_raw.get("freq_hz", 800000),
dma=led_raw.get("dma", 10),
strip_type=led_raw.get("strip_type", "WS2812"),
@@ -221,6 +223,24 @@ class ConfigService:
self.load()
return self._config
def save_led_brightness(self, brightness: int):
with open(self.path, encoding="utf-8") as f:
raw = yaml.safe_load(f) or {}
raw.setdefault("leds", {})["brightness"] = brightness
with open(self.path, "w", encoding="utf-8") as f:
yaml.dump(raw, f, allow_unicode=True, default_flow_style=False)
if self._config:
self._config.leds.brightness = brightness
def save_led_auto_brightness(self, enabled: bool):
with open(self.path, encoding="utf-8") as f:
raw = yaml.safe_load(f) or {}
raw.setdefault("leds", {})["auto_brightness"] = enabled
with open(self.path, "w", encoding="utf-8") as f:
yaml.dump(raw, f, allow_unicode=True, default_flow_style=False)
if self._config:
self._config.leds.auto_brightness = enabled
def save_led_effect(self, effect_name: str, effect_data: dict):
with open(self.path, encoding="utf-8") as f:
raw = yaml.safe_load(f) or {}