fix: timing flash + couleur idle LED + diagnostic auto-brightness
This commit is contained in:
@@ -228,6 +228,24 @@ class ConfigService:
|
||||
self._config.print.user_print_quota = quota
|
||||
self._config.print.user_print_max_copies = max_copies
|
||||
|
||||
def save_printer_excluded(self, printer_name: str, excluded: bool):
|
||||
"""Marque (ou démarque) une imprimante comme exclue du load-balancing."""
|
||||
with open(self.path, encoding="utf-8") as f:
|
||||
raw = yaml.safe_load(f) or {}
|
||||
printers = raw.get("print", {}).get("printers", [])
|
||||
for p in printers:
|
||||
if isinstance(p, dict) and p.get("name") == printer_name:
|
||||
p["excluded"] = excluded
|
||||
break
|
||||
raw.setdefault("print", {})["printers"] = printers
|
||||
with open(self.path, "w", encoding="utf-8") as f:
|
||||
yaml.dump(raw, f, allow_unicode=True, default_flow_style=False)
|
||||
if self._config:
|
||||
for p in self._config.print.printers:
|
||||
if isinstance(p, dict) and p.get("name") == printer_name:
|
||||
p["excluded"] = excluded
|
||||
break
|
||||
|
||||
def save_print_mode(self, mode: str):
|
||||
with open(self.path, encoding="utf-8") as f:
|
||||
raw = yaml.safe_load(f) or {}
|
||||
|
||||
Reference in New Issue
Block a user