mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-17 01:04:05 +02:00
merge with origin\main
This commit is contained in:
parent
ccf18c3879
commit
dced97b5ca
22 changed files with 1433 additions and 517 deletions
25
.github/update-services.py
vendored
Normal file
25
.github/update-services.py
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
from pathlib import Path
|
||||
import sys
|
||||
|
||||
import yaml
|
||||
|
||||
sys.path.append(str(Path(__file__).parent.parent))
|
||||
|
||||
from custom_components.adaptive_lighting import const # noqa: E402
|
||||
|
||||
services_filename = "custom_components/adaptive_lighting/services.yaml"
|
||||
with open(services_filename) as f:
|
||||
services = yaml.safe_load(f)
|
||||
|
||||
for service_name, dct in services.items():
|
||||
_docs = {"set_manual_control": const.DOCS_MANUAL_CONTROL, "apply": const.DOCS_APPLY}
|
||||
alternative_docs = _docs.get(service_name, const.DOCS)
|
||||
for field_name, field in dct["fields"].items():
|
||||
description = alternative_docs.get(field_name, const.DOCS[field_name])
|
||||
field["description"] = description
|
||||
|
||||
comment = "# This file is auto-generated by .github/update-services.py."
|
||||
|
||||
with open(services_filename, "w") as f:
|
||||
f.write(comment + "\n")
|
||||
yaml.dump(services, f, sort_keys=False, width=1000, allow_unicode=True)
|
||||
Loading…
Add table
Add a link
Reference in a new issue