mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-19 02:04:05 +02:00
Style with ruff and logging (#643)
* Formatting with ruff * more logging * Require on_only * Different implementation * More ruff * Remove new logging statements * Remove 'pylint: disable=protected' * style * fixes * ruff * Switch to ruff * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix .github * Fix * Add ignores * fix arg * fix B905 * Fix D * Fix more * Fix more * order * use path * moer path * Remove unused ignores * fix tes deps * fix typo --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
97f388608a
commit
bb84684bce
12 changed files with 326 additions and 246 deletions
9
.github/update-services.py
vendored
9
.github/update-services.py
vendored
|
|
@ -1,5 +1,6 @@
|
|||
from pathlib import Path
|
||||
"""Creates a services.yaml file with the latest docs."""
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
|
||||
|
|
@ -7,8 +8,8 @@ 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_filename = Path("custom_components") / "adaptive_lighting" / "services.yaml"
|
||||
with open(services_filename) as f: # noqa: PTH123
|
||||
services = yaml.safe_load(f)
|
||||
|
||||
for service_name, dct in services.items():
|
||||
|
|
@ -20,6 +21,6 @@ for service_name, dct in services.items():
|
|||
|
||||
comment = "# This file is auto-generated by .github/update-services.py."
|
||||
|
||||
with open(services_filename, "w") as f:
|
||||
with services_filename.open("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