mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-11 22:34:04 +02:00
* Rename TurnOnOffListener to AdaptiveLightingManager * Bump Python version * Refactor and unify methods that are called once * Simplify adaptation_utils.py * Improve readability in adaptation_utils.py * More renames * Simplify * More renames and simplifications * fix test * simplify _supported_features * rename * walrus * drop old astral support * Only support HA ≥2021.06 * Require 2016.06 * Try 2023.1 * even more old versions * test * more versions * verify that only ≥2022.11 works * named args * setdefault * no astral v1 * var * simplify * no need to pass adapt_brightness and adapt_color * Add comment
37 lines
1,019 B
Python
37 lines
1,019 B
Python
from collections import defaultdict
|
|
|
|
deps = defaultdict(list)
|
|
components, packages = [], []
|
|
|
|
with open("core/requirements_test_all.txt") as f:
|
|
lines = f.readlines()
|
|
|
|
for line in lines:
|
|
line = line.strip()
|
|
|
|
if line.startswith("# homeassistant."):
|
|
if components and packages:
|
|
for component in components:
|
|
deps[component].extend(packages)
|
|
components, packages = [], []
|
|
components.append(line.split("# homeassistant.")[1])
|
|
elif components and line:
|
|
packages.append(line)
|
|
|
|
# The last batch of components and packages
|
|
if components and packages:
|
|
for component in components:
|
|
deps[component].extend(packages)
|
|
|
|
required = [
|
|
"components.recorder",
|
|
"components.mqtt",
|
|
"components.zeroconf",
|
|
"components.http",
|
|
"components.stream",
|
|
"components.conversation", # only available after HA≥2023.2
|
|
"components.cloud",
|
|
]
|
|
to_install = [package for r in required for package in deps[r]]
|
|
|
|
print(" ".join(to_install))
|