mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
Fix length of descriptions in UI (config flow) (#732)
* Fix length of strings in UI * Update README.md, strings.json, and services.yaml * fix * add desc * Update README.md, strings.json, and services.yaml * mention webapp * Add desc * link --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
487756b345
commit
5b7ee44629
3 changed files with 106 additions and 47 deletions
13
.github/update-strings.py
vendored
13
.github/update-strings.py
vendored
|
|
@ -3,6 +3,7 @@ import json
|
|||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
import yaml
|
||||
|
||||
sys.path.append(str(Path(__file__).parent.parent))
|
||||
|
|
@ -16,8 +17,17 @@ with strings_fname.open() as f:
|
|||
strings = json.load(f)
|
||||
|
||||
# Set "options"
|
||||
data = {k: f"{k}: {const.DOCS[k]}" for k, _, _ in const.VALIDATION_TUPLES}
|
||||
data = {}
|
||||
data_description = {}
|
||||
for k, _, typ in const.VALIDATION_TUPLES:
|
||||
desc = const.DOCS[k]
|
||||
if len(desc) > 40 and typ != bool and typ != cv.entity_ids:
|
||||
data[k] = k
|
||||
data_description[k] = desc
|
||||
else:
|
||||
data[k] = f"{k}: {desc}"
|
||||
strings["options"]["step"]["init"]["data"] = data
|
||||
strings["options"]["step"]["init"]["data_description"] = data_description
|
||||
|
||||
# Set "services"
|
||||
services_filename = Path("custom_components") / "adaptive_lighting" / "services.yaml"
|
||||
|
|
@ -48,6 +58,7 @@ with en_fname.open() as f:
|
|||
|
||||
en["config"]["step"]["user"] = strings["config"]["step"]["user"]
|
||||
en["options"]["step"]["init"]["data"] = data
|
||||
en["options"]["step"]["init"]["data_description"] = data_description
|
||||
en["services"] = services_json
|
||||
|
||||
with en_fname.open("w") as f:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue