-
Notifications
You must be signed in to change notification settings - Fork 516
/
Copy pathconfig.py
39 lines (31 loc) · 1.18 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from jetson_containers import update_dependencies, get_json_value_from_url
from packaging.version import Version
def create_package(version, sqlite_version='3.40.1', default=False) -> list:
pkg = package.copy()
url = 'https://version.home-assistant.io/stable.json'
wanted_version = get_json_value_from_url(url, 'homeassistant.default') if version == 'latest' else version
pkg['name'] = f'homeassistant-core:{wanted_version}'
ha_version = Version(wanted_version)
if ha_version.major >= 2024:
if ha_version.minor >= 4:
required_python = 'python:3.12'
else:
required_python = 'python:3.11'
elif ha_version.major >= 2023 and ha_version.minor >= 8:
required_python = 'python:3.11'
else:
required_python = 'python'
pkg['depends'] = update_dependencies(pkg['depends'], [required_python])
pkg['build_args'] = {
'HA_VERSION': wanted_version,
'SQLITE_VERSION': sqlite_version
}
if default:
pkg['alias'] = 'homeassistant-core'
return pkg
package = [
# latest
create_package('latest', default=True),
# specific version
create_package('2024.4.2', default=False),
]