Compare commits

...

157 Commits

Author SHA1 Message Date
Paulus Schoutsen
ec897081cd Update supervisor/api/__init__.py 2022-01-20 14:58:00 -08:00
Paulus Schoutsen
839361133a Add refresh updates API endpoint 2022-01-20 10:14:37 -08:00
Joakim Sørensen
b651d63758 Add backup size to list API (#3409) 2022-01-19 08:59:30 -08:00
dependabot[bot]
400d3981a2 Bump pre-commit from 2.16.0 to 2.17.0 (#3407)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-19 09:16:13 +01:00
Stefan Agner
69c2517d52 Fix local Add-on restore on blank instance (#3403)
Make sure to not reference version attribute from the DockerAddon
instance since it is not yet populated in case this instance hadn't
installed that Add-on previously.

Use the higher level Images.load() API which returns a list of images
instead of loading with the lower level API and then search for the
image we just imported.
2022-01-11 16:55:19 +01:00
Stefan Agner
c8b49aba42 Avoid sending backup start notification to HA Core 2021.12 (#3400) 2022-01-11 13:20:19 +01:00
Stefan Agner
8071b107e7 Release all pending WebSocket calls on connection close (#3401) 2022-01-11 13:18:49 +01:00
dependabot[bot]
603d19b075 Bump sentry-sdk from 1.5.1 to 1.5.2 (#3398)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 09:04:24 +01:00
dependabot[bot]
a5ce2ef7cb Bump gitpython from 3.1.25 to 3.1.26 (#3399)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-11 08:36:23 +01:00
dependabot[bot]
f392dc5492 Bump awesomeversion from 21.12.0 to 22.1.0 (#3397)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-10 09:04:58 +01:00
dependabot[bot]
0c63883269 Bump gitpython from 3.1.24 to 3.1.25 (#3394)
Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.24 to 3.1.25.
- [Release notes](https://github.com/gitpython-developers/GitPython/releases)
- [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES)
- [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.24...3.1.25)

---
updated-dependencies:
- dependency-name: gitpython
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-09 21:47:50 +01:00
dependabot[bot]
612d4f950b Bump pyupgrade from 2.30.0 to 2.31.0 (#3390)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-01-06 16:14:24 +01:00
Stefan Agner
1799c765b4 Notify HA Core when backup is being executed (#3305)
* Notify HA Core when backup is being executed

Notify Home Assistant Core using the Websocket API when the Home Assistant
config directory is about to get backed up. This makes sure the Core can
prepare the SQLite database (if active) so it safe to make a backup.

* Only close WebSocket connection on connection errors

Let regular WebSocket errors bubble to the caller so they can be handled
explicitly.

* Add version restriction to backup/start/end WS commands

* Restore Home Assistant metadata when Home Assistant is selected
2022-01-05 11:57:41 +01:00
Allen Porter
809ac1ffca Add Add-on discovery schema for rtsp-to-webrtc (#3392) 2022-01-05 11:30:15 +01:00
Allen Porter
fefc99e825 Fix copy/paste issues in tests (#3393) 2022-01-05 10:01:00 +01:00
Allen Porter
d994170a9d Fix copy-paste error in pydoc for test_almond.py (#3389) 2022-01-02 16:09:46 +01:00
Stefan Agner
d8c934365a Exclude old log files from backup (#3307)
Currently log files are excluded from the backup. Core uses a time or
startup based log rotation mechanism, both append a dot and an
additional; string (`.1`, `.{timestamp}`). There is also a fault
mechanism which creates a log file with the ending `.log.fault`. Exclude
all cases from the backup.
2021-12-28 17:40:32 +01:00
Joakim Sørensen
e0fd31c390 Create backup of add-ons and core before update (#3369)
* Create backup of addons and core before update

* Move responsibility
2021-12-28 11:13:54 +01:00
dependabot[bot]
22238c9c0e Bump awesomeversion from 21.11.0 to 21.12.0 (#3379)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.11.0 to 21.12.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.11.0...21.12.0)

---
updated-dependencies:
- dependency-name: awesomeversion
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-28 11:10:36 +01:00
dependabot[bot]
5ff96cfa5e Bump pyupgrade from 2.29.1 to 2.30.0 (#3381)
* Bump pyupgrade from 2.29.1 to 2.30.0

Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.29.1 to 2.30.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.29.1...v2.30.0)

---
updated-dependencies:
- dependency-name: pyupgrade
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update .pre-commit-config.yaml

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-12-28 11:09:28 +01:00
dependabot[bot]
e22a19df1a Bump cryptography from 35.0.0 to 36.0.1 (#3365)
Bumps [cryptography](https://github.com/pyca/cryptography) from 35.0.0 to 36.0.1.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/35.0.0...36.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-23 14:09:19 +01:00
dependabot[bot]
f57bc0db25 Bump async-timeout from 4.0.1 to 4.0.2 (#3376)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 10:57:51 +01:00
dependabot[bot]
6ba6b5ea56 Bump pylint from 2.12.1 to 2.12.2 (#3341)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 10:52:58 +01:00
dependabot[bot]
5dc9f9235e Bump docker/login-action from 1.10.0 to 1.12.0 (#3375)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-21 10:51:43 +01:00
Franck Nijhof
323fa2e637 Change CI cache restore policy (#3377) 2021-12-21 10:47:20 +01:00
dependabot[bot]
0986419b2f Bump deepmerge from 0.3.0 to 1.0.1 (#3373)
Bumps [deepmerge](https://github.com/toumorokoshi/deepmerge) from 0.3.0 to 1.0.1.
- [Release notes](https://github.com/toumorokoshi/deepmerge/releases)
- [Commits](https://github.com/toumorokoshi/deepmerge/commits)

---
updated-dependencies:
- dependency-name: deepmerge
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 12:26:03 +01:00
dependabot[bot]
f0bc952269 Bump home-assistant/builder from 2021.11.4 to 2021.12.0 (#3359)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.11.4 to 2021.12.0.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.11.4...2021.12.0)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 12:25:20 +01:00
dependabot[bot]
9266997482 Bump sentry-sdk from 1.5.0 to 1.5.1 (#3360)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.5.0...1.5.1)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 12:24:54 +01:00
dependabot[bot]
75d252e21a Bump pytest-timeout from 2.0.1 to 2.0.2 (#3361)
Bumps [pytest-timeout](https://github.com/pytest-dev/pytest-timeout) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/pytest-dev/pytest-timeout/releases)
- [Commits](https://github.com/pytest-dev/pytest-timeout/compare/2.0.1...2.0.2)

---
updated-dependencies:
- dependency-name: pytest-timeout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-20 12:24:24 +01:00
Joakim Sørensen
368e94f95f Bump frontend to 2f9c0880 (#3374) 2021-12-20 11:51:31 +01:00
Stefan Agner
3fbecf89db Enable asyncio debug in developer mode (#3348) 2021-12-16 10:50:56 +01:00
dependabot[bot]
54e6ae5fd9 Bump actions/upload-artifact from 2.3.0 to 2.3.1 (#3368)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-16 08:24:10 +01:00
Stefan Agner
5b96074055 Log if board reported by HAOS isn't in version file (#3366)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-12-15 16:45:18 +01:00
Joakim Sørensen
5503f93a75 Don't remove add-on repos if add-on is installed (#3364) 2021-12-14 21:04:31 +01:00
Stefan Agner
eadc629cd9 De-duplicate Backup/Restore logic (#3311)
* De-duplicate Backup/Restore logic

Create internal _do_backup()/_do_restore() method which de-duplicates
some of the backup/restore logic previously part of full/partial backup/restore.

* Add Backup/Restore test coverage
2021-12-14 17:21:52 +00:00
Stefan Agner
cde45e2e7a Address pytest warnings (#3347)
* Avoid accessing properties of udevice.parent

The if statement currently causes access of a property of
udevice.parent, leading to:
tests/hardware/test_module.py: 104 warnings
  /workspaces/supervisor/supervisor/hardware/data.py:50: DeprecationWarning: Will be removed in 1.0. Access properties with Device.properties.

Change the if statement to avoid property access and the deprecation
warning.

* Create task before using asyncio.wait()

Avoid deprecation warnings such as:
tests/store/test_custom_repository.py: 5 warnings
  /workspaces/supervisor/supervisor/store/__init__.py:113: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
    await asyncio.wait(tasks)
2021-12-14 15:30:22 +00:00
Franck Nijhof
050851a9ac Update ruamel.yaml to 0.17.17 (#3363) 2021-12-14 14:00:46 +01:00
dependabot[bot]
86bd16b2ba Bump black from 21.11b1 to 21.12b0 (#3342)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-12-14 02:14:38 +01:00
Joakim Sørensen
ce9181b05f Bump frontend to a7b558b6 (#3357) 2021-12-13 18:57:47 +01:00
Joakim Sørensen
f7ba364076 Bump frontend to 0a7b703d (#3346) 2021-12-08 10:13:47 +01:00
dependabot[bot]
3511c19726 Bump actions/upload-artifact from 2.2.4 to 2.3.0 (#3344)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-08 08:34:50 +01:00
Joakim Sørensen
d9ed58696b Bump frontend to 6877fd9e (#3338) 2021-12-02 20:42:42 +01:00
Joakim Sørensen
373f452774 Fix path name for build file (#3328) 2021-12-02 11:54:49 +01:00
dependabot[bot]
e54efa681f Bump pre-commit from 2.15.0 to 2.16.0 (#3335)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-01 07:49:54 +01:00
Stefan Agner
79cd8ac390 Allow to clear explicit image name (#3333)
The documentation says that passing null to `image` allows to clear
the option. Currently `null` is not allowed leading to:
Error: expected string or buffer for dictionary value @ data['image']. Got None

While at it, also update type annotation to reflect what the API
currently allows.
2021-11-30 18:48:09 +01:00
dependabot[bot]
dc24f332f8 Bump actions/setup-python from 2.3.0 to 2.3.1 (#3332)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-30 09:11:28 +01:00
dependabot[bot]
99cdf7b028 Bump sentry-sdk from 1.4.3 to 1.5.0 (#3316)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 23:01:27 +01:00
Joakim Sørensen
54edfa53bc Bump pylint from 2.11.1 to 2.12.1 (#3330) 2021-11-29 22:56:38 +01:00
Joakim Sørensen
571c9a05c6 Bump aiohttp and friends (#3329) 2021-11-29 22:34:42 +01:00
dependabot[bot]
864b7bf023 Bump jinja2 from 3.0.2 to 3.0.3 (#3296)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 17:40:34 +01:00
dependabot[bot]
e303431d74 Bump awesomeversion from 21.10.1 to 21.11.0 (#3308)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 17:27:52 +01:00
dependabot[bot]
19dd40275c Bump black from 21.9b0 to 21.11b1 (#3278)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-11-29 17:22:07 +01:00
Joakim Sørensen
4cf970e37a WS connection fix (#3317) 2021-11-29 17:21:09 +01:00
dependabot[bot]
7947c27089 Bump pytest-timeout from 1.4.2 to 2.0.1 (#3227)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 17:08:42 +01:00
Joakim Sørensen
d0e2c8b694 Split homeassistant watchdog conditions (#3318) 2021-11-29 17:03:49 +01:00
dependabot[bot]
19e3a859b0 Bump pyupgrade from 2.29.0 to 2.29.1 (#3306)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-11-29 16:59:46 +01:00
dependabot[bot]
e6557ded34 Bump actions/cache from 2.1.6 to 2.1.7 (#3320)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 16:54:08 +01:00
dependabot[bot]
f4aae4522d Bump actions/setup-python from 2.2.2 to 2.3.0 (#3315)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 16:50:40 +01:00
Joakim Sørensen
2066aefd6d Bump frontend to e91d1777 (#3326) 2021-11-29 15:45:14 +01:00
dependabot[bot]
2f56cab953 Bump home-assistant/builder from 2021.09.0 to 2021.11.4 (#3323)
* Bump home-assistant/builder from 2021.09.0 to 2021.11.4

Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2021.09.0 to 2021.11.4.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2021.09.0...2021.11.4)

---
updated-dependencies:
- dependency-name: home-assistant/builder
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* CAS fixes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-11-29 15:43:04 +01:00
dependabot[bot]
883399f583 Bump pytest-cov from 2.12.1 to 3.0.0 (#3192)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 15:16:41 +01:00
dependabot[bot]
47f53501e5 Bump coverage from 5.5 to 6.2 (#3324)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-29 14:46:12 +01:00
Joakim Sørensen
b23a89e6fb Bump frontend to a567312b (#3313) 2021-11-17 10:53:20 -08:00
Stefan Agner
7764decc37 Fix grammer of some error messages (#3310) 2021-11-17 15:41:35 +01:00
Joakim Sørensen
88490140af Add /supervisor/available_updates endpoint (#3300) 2021-11-17 09:28:46 +01:00
Pascal Vizeli
61d56dce9c Reload secrets on options config (#3292) 2021-11-11 12:09:50 +01:00
Pascal Vizeli
838af87ad7 Fix: using deep merge for test update schema (#3297) 2021-11-10 11:34:57 +01:00
dependabot[bot]
8f263ab345 Bump colorlog from 6.5.0 to 6.6.0 (#3294)
Bumps [colorlog](https://github.com/borntyping/python-colorlog) from 6.5.0 to 6.6.0.
- [Release notes](https://github.com/borntyping/python-colorlog/releases)
- [Commits](https://github.com/borntyping/python-colorlog/compare/v6.5.0...v6.6.0)

---
updated-dependencies:
- dependency-name: colorlog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-09 09:54:22 +01:00
Pascal Vizeli
6b76086652 Handle whoami SSL error less strict (#3293) 2021-11-08 14:40:45 +01:00
Pascal Vizeli
efa5205800 Using rolling token on observer (#3286) 2021-11-04 10:18:44 +01:00
Philip Allgaier
a0c8b77737 Fix typo in HA startup message (#3287) 2021-11-03 23:19:34 +01:00
dependabot[bot]
9ee0efe6c0 Bump actions/checkout from 2.3.5 to 2.4.0 (#3285)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-03 08:17:16 +01:00
dependabot[bot]
a2af63d050 Bump flake8 from 3.9.2 to 4.0.1 (#3228)
Bumps [flake8](https://github.com/pycqa/flake8) from 3.9.2 to 4.0.1.
- [Release notes](https://github.com/pycqa/flake8/releases)
- [Commits](https://github.com/pycqa/flake8/compare/3.9.2...4.0.1)

---
updated-dependencies:
- dependency-name: flake8
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-01 16:36:00 +01:00
Pascal Vizeli
da246dc40a Fix AppArmor cache path (#3272) 2021-10-27 15:59:28 +02:00
Pascal Vizeli
3c52f87cdc Host Apparmor version on info (#3271) 2021-10-27 14:58:33 +02:00
Pascal Vizeli
d80d76a24d Using AppArmor from OS-Agent (#3254)
* Using AppArmor from OS-Agent

* cleanup
2021-10-27 12:55:31 +02:00
dependabot[bot]
8653f7a0e1 Bump awesomeversion from 21.8.1 to 21.10.1 (#3257)
* Bump awesomeversion from 21.8.1 to 21.10.1

Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 21.8.1 to 21.10.1.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/21.8.1...21.10.1)

---
updated-dependencies:
- dependency-name: awesomeversion
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix exception name

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-10-26 17:43:12 +02:00
Joakim Sørensen
8458d9e0f6 Only get stats for running containers (#3268) 2021-10-26 17:43:02 +02:00
Joakim Sørensen
5d4ce94155 Return directly for set_property (#3265)
* Return directly for set_property

* Fix typehint
2021-10-26 14:19:57 +02:00
Joakim Sørensen
828cf773cc Direct import from docker modules to get better typing (#3266) 2021-10-26 14:18:03 +02:00
Joakim Sørensen
a902b55df7 Remove note in log about removing containers (#3263)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-10-26 00:06:48 +02:00
Joakim Sørensen
f38cde4c68 Ignore intermediate images (#3264) 2021-10-26 00:06:26 +02:00
Pascal Vizeli
4c9cbb112e Fix dbus timeout on connection (#3258) 2021-10-25 14:19:09 +02:00
Stefan Agner
3d814f3c44 Network settings IPv6 fixes (#3251)
* Fix static assignment of IPv6 addresses

* Support statically assigned link local addresses

Statically assigned link local addresses are perfectly supported in IPv6
use cases.
2021-10-22 10:50:15 +02:00
Joakim Sørensen
f269f72082 Bump frontend to d05c7635 (#3250) 2021-10-22 10:49:13 +02:00
Stefan Agner
f07193dc3c Handle empty Add-on backup properly (#3253)
* Handle empty Add-on backup properly

Check if the data directory exist in the backup. If not, make sure a
directory gets created so the options.json can be written afterwards.

* Remove unrelated change
2021-10-22 10:48:53 +02:00
Stefan Agner
d2b706df05 Ignore disappearing network devices while querying them (#3249)
Sometimes NetworkManager network devices disappear while we are query
them. Presumably those are network interfaces generated by Docker.
Skip them and print a warning.
2021-10-20 15:06:36 +02:00
Stefan Agner
e5817e9445 D-Bus signal handling improvements (#3248)
* Allow to update connection information

* Introduce Signal wrapper class using async context manager

This allows to start monitoring signals and execute code before
processing signals. With that it is possible to check for state changes
in a race free manor.

* Fix unit tests
2021-10-20 14:40:28 +02:00
Joakim Sørensen
85313f26ea Handle unbound introspection (#3247) 2021-10-20 11:51:10 +02:00
Pascal Vizeli
f864613ffb Handle EOFError with dbus-next (#3246) 2021-10-20 11:37:44 +02:00
Joakim Sørensen
36ea8b2bb4 Update frontend to b760e543 (#3245) 2021-10-20 11:01:53 +02:00
Joakim Sørensen
df9d62f874 Fix update frontend script (#3244) 2021-10-19 19:42:47 +02:00
dependabot[bot]
4a6aaa8559 Bump pulsectl from 21.9.1 to 21.10.5 (#3237)
Bumps [pulsectl](https://github.com/mk-fg/python-pulse-control) from 21.9.1 to 21.10.5.
- [Release notes](https://github.com/mk-fg/python-pulse-control/releases)
- [Changelog](https://github.com/mk-fg/python-pulse-control/blob/master/CHANGES.rst)
- [Commits](https://github.com/mk-fg/python-pulse-control/commits)

---
updated-dependencies:
- dependency-name: pulsectl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-19 18:22:28 +02:00
Stefan Agner
435f479984 D-Bus NetworkManager improvements (#3243)
* Introduce enum for network connectivity

* Differentiate between Bus Name and Interface consts

The Bus names and interfaces look quite similar in D-Bus: Both use dots
to separate words. Usually all interfaces available below a certan Bus
name start with the Bus name. Quite often the Bus name itself is also
available as an interface.

However, those are different things. To avoid confusion, add the type of
const to the const name.

* Remove unused const

* Disconnect D-Bus when not used

Make sure Python disconnects from D-Bus when objects get destroyed. This
avoids exhausting D-Bus connection limit which causes the following
error message:
[system] The maximum number of active connections for UID 0 has been reached (max_connections_per_user=256)

* Filter signals by object as well

Make sure we only listen to signals on that particular object. Also
support filtering messages via message filter callback.

* Explicitly wait until Connection is activated

Wait for activated or raise an error. This avoids too early/errornous
updates when state of the connection changes to "activating" or similar
intermediate signal states.

Fixes: #2639

* Fix VLAN configuration

* Add link to D-Bus object documentation

* Fix network settings update test

* Make MessageBus object optional
2021-10-19 16:38:52 +02:00
dependabot[bot]
e2f39059c6 Bump cryptography from 3.4.6 to 35.0.0 (#3170)
Bumps [cryptography](https://github.com/pyca/cryptography) from 3.4.6 to 35.0.0.
- [Release notes](https://github.com/pyca/cryptography/releases)
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/3.4.6...35.0.0)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-19 15:05:25 +02:00
dependabot[bot]
531073d5ec Bump debugpy from 1.5.0 to 1.5.1 (#3242)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.5.0...v1.5.1)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-19 14:52:11 +02:00
Joakim Sørensen
ef5b6a5f4c Rename unsupported reason container to software (#3240)
* Rename unsupported reason container to software

* rename in tests
2021-10-19 11:26:58 +02:00
Joakim Sørensen
03f0a136ab Remove vcn from Dockerfile (#3241) 2021-10-19 10:08:53 +02:00
Stefan Agner
7a6663ba80 Use Python dbus-next D-Bus library (#3234)
* Use the correct interface name to get properties of systemd

It seems that gdbus (or systemd) automatically pick the correct
interface and return the properties. However, dbussy requires the
correct interface name to get all properties.

* Don't expect array from Strength property

The property returns a type "y" which equates to "guchar":
https://developer-old.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.AccessPoint.html#gdbus-property-org-freedesktop-NetworkManager-AccessPoint.Strength

It seems that the old D-Bus implementation returned an array. With
dbus-next a integer is returned, so no list indexing required.

* Support signals and remove no longer used tests and code

* Pass rauc update file path as string

That is what the interface is expecting, otherwise the new lib chocks on
the Pathlib type.

* Support Network configuration with dbus-next

Assemble Python native objects and pass them to dbus-next. Use dbus-next
specific Variant class where necessary.

* Use org.freedesktop.NetworkManager.Connection.Active.StateChanged

org.freedesktop.NetworkManager.Connection.Active.PropertyChanged is
depricated. Also it seems that StateChanged leads to fewer and more
accurate signals.

* Pass correct data type to RequestScan.

RequestScan expects an option dictionary. Pass an empty option
dictionary to it.

* Update unit tests

Replace gdbus specific fixtures with json files representing the return
values. Those can be easily converted into native Python objects.

* Rename D-Bus utils module gdbus to dbus
2021-10-18 23:06:44 +02:00
Stefan Agner
9dd5eee1ae Update to isort 5.9.3 (#3238) 2021-10-18 20:28:38 +02:00
Joakim Sørensen
bb474a5c14 Only run container evaluation when system is running (#3239)
* Only run container evaluation when system is running

* adjust test
2021-10-18 20:25:50 +02:00
Joakim Sørensen
6ab4dda5e8 Set agent diagnostics (#3203)
* Set agent diagnostics

* Add AttributeError to dbus_property wrapper

* Use dbus_property instead of dbus_connected

* Move sync to core setup
2021-10-18 14:48:47 +02:00
Joakim Sørensen
8a553dbb59 Adjust container evaluation (#3174)
* Adjust container evaluation

* remove test
2021-10-18 13:58:51 +02:00
dependabot[bot]
1ee6c0491c Bump sentry-sdk from 1.4.2 to 1.4.3 (#3171)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.4.2 to 1.4.3.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.4.2...1.4.3)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 10:59:45 +02:00
dependabot[bot]
cc50a91a42 Bump debugpy from 1.4.3 to 1.5.0 (#3202)
Bumps [debugpy](https://github.com/microsoft/debugpy) from 1.4.3 to 1.5.0.
- [Release notes](https://github.com/microsoft/debugpy/releases)
- [Commits](https://github.com/microsoft/debugpy/compare/v1.4.3...v1.5.0)

---
updated-dependencies:
- dependency-name: debugpy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 10:57:08 +02:00
Joakim Sørensen
637377f81d Replace devcontainer (#3175) 2021-10-18 10:44:28 +02:00
Vighnesh Kadam
a90f70e017 Use new format for logging exceptions - docker/network.py (#3220) 2021-10-18 10:09:21 +02:00
dependabot[bot]
949ecb255d Bump actions/checkout from 2.3.4 to 2.3.5 (#3236)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-18 08:33:53 +02:00
Anand Borkar
15f62837c8 Use new format for logging exceptions - docker/supervisor.py (#3221) 2021-10-08 16:03:30 +02:00
dependabot[bot]
e5246a5b1d Bump jinja2 from 3.0.1 to 3.0.2 (#3201)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-08 10:51:09 +02:00
Anand Borkar
394d66290d Use new format for logging exceptions - host/services.py (#3213)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-10-08 10:21:47 +02:00
dependabot[bot]
79d541185f Bump colorlog from 6.4.1 to 6.5.0 (#3216)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-08 10:09:10 +02:00
dependabot[bot]
b433d129ef Bump docker from 5.0.2 to 5.0.3 (#3215)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-08 10:08:24 +02:00
Samprit | Nekrós
4b0278fee8 Use new format for logging exceptions - store/repository.py (#3212) 2021-10-08 09:46:52 +02:00
Joakim Sørensen
8c59e6d05a Bump frontend to 910cd98a (#3211) 2021-10-07 13:11:03 +02:00
Joakim Sørensen
5c66278a1c Bump frontend to 066a0771 (#3210) 2021-10-07 11:37:16 +02:00
Vedant Bhamare
7abe9487a0 Use new format for logging exceptions - resolution/module.py (#3207) 2021-10-06 20:03:48 +02:00
Vedant Bhamare
73832dd6d6 Use new format for logging exceptions - plugins/multicast.py (#3206) 2021-10-06 19:52:07 +02:00
Vedant Bhamare
6cc3df54e9 Use new format for logging exceptions - plugins/audio.py (#3205) 2021-10-06 19:42:45 +02:00
Samprit | Nekrós
c07c7c5146 Use new format for logging exceptions - host/info.py (#3204)
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-10-06 13:01:04 +02:00
Balamurugan P
a6d1078fe3 Use new format for logging exceptions - docker/interface.py (#3184)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-10-04 22:49:55 +02:00
Joakim Sørensen
eba6da485d Rename disk_data to data_disk (#3200) 2021-10-04 22:46:28 +02:00
Prathamesh Gawas
de880e24ed Use new format for logging exceptions - host/apparmor.py (#3197) 2021-10-04 22:29:20 +02:00
Prathamesh Gawas
f344df9e5c Use new format for logging exceptions - host/network.py (#3196) 2021-10-04 22:23:55 +02:00
Prathamesh Gawas
5af62a8834 Use new format for logging exceptions - dbus/network/__init__.py (#3195) 2021-10-04 22:20:39 +02:00
Vighnesh Kadam
800fb683f8 Use new format for logging exceptions - plugins/dns.py (#3191)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-10-03 18:33:30 +02:00
Vedant Bhamare
ad2566d58a Use new format for logging exceptions - docker/init.py (#3189) 2021-10-03 12:33:55 +02:00
Vedant Bhamare
6c679b07e1 Use new format for logging exceptions - utils/apparmor.py (#3190) 2021-10-03 12:31:51 +02:00
Vighnesh Kadam
aa4f4c8d47 Use new format for logging exceptions - plugins/cli.py (#3188) 2021-10-03 10:16:49 +02:00
Anand Borkar
b83da5d89f Use new format for logging exceptions - api/proxy.py (#3187) 2021-10-02 11:29:12 +02:00
Vedant Bhamare
0afff9a9e2 Use new format for logging exceptions - services/modules/mqtt.py (#3183) 2021-10-01 14:46:36 +02:00
Finn
0433d72ae6 Use new format for logging exception - homeassistent/api.py (#3182) 2021-10-01 14:18:23 +02:00
Vedant Bhamare
d33beb06cd Use new format for logging exceptions - services/modules/mysql.py (#3180) 2021-10-01 14:03:16 +02:00
Prathamesh Gawas
279d6ccd79 Use new format for logging exceptions - host/sound.py (#3176) 2021-10-01 14:01:12 +02:00
Finn
af628293f3 Use new format for logging exceptions - addons/init.py (#3179)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
2021-10-01 13:46:46 +02:00
Finn
df6b815175 Use new format for logging exceptions - addons/addon.py (#3178) 2021-10-01 13:23:57 +02:00
Finn
d6127832a7 Use new format for logging exceptions - auth.py (#3177) 2021-10-01 13:23:38 +02:00
Joakim Sørensen
8240623806 Fix observer security filter (#3173) 2021-09-30 15:12:04 +02:00
Joakim Sørensen
2b4527fa64 Return early in validate (#3168)
* Return early in validate

* pylint
2021-09-29 18:33:45 +02:00
Joakim Sørensen
23143aede4 Add all_plugins to cleanup code (#3166) 2021-09-29 18:23:25 +02:00
dependabot[bot]
8b93f0aee7 Bump pyupgrade from 2.28.1 to 2.29.0 (#3165)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-29 17:47:04 +02:00
Stefan Agner
5cc4a9a929 Use = instead of deprecated : as security option separator (#3167)
Docker reports:
Sep 23 08:16:31 homeassistant dockerd[467]: time="2021-09-23T08:16:31.771717436Z" level=warning msg="Security options with `:` as a separator are deprecated and will be completely unsupported in 17.04, use `=` instead."

Since it seems that Docker supports `=` since quite a while, we should
use `=` only.
2021-09-29 16:42:41 +02:00
Pascal Vizeli
288d2e5bdb Use deepmerge for options (#3162)
* Use deepmerge for options

* fix issue

* Update supervisor/addons/addon.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

* Add tests

* Fix merge schema

* Make save for overwrites

* drop community

* more cleanup

* Fix tests

* Fix lists

* revert strategy

* protect overwritten lists

* Update tests/api/test_store.py

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-09-29 09:37:04 +02:00
dependabot[bot]
73d84113ea Bump sentry-sdk from 1.4.1 to 1.4.2 (#3159)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/getsentry/sentry-python/releases)
- [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md)
- [Commits](https://github.com/getsentry/sentry-python/compare/1.4.1...1.4.2)

---
updated-dependencies:
- dependency-name: sentry-sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-28 09:57:17 +02:00
dependabot[bot]
4b15945ca1 Bump pyupgrade from 2.28.0 to 2.28.1 (#3160)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2021-09-28 09:43:00 +02:00
dependabot[bot]
10720b2988 Bump dessant/lock-threads from 2.1.2 to 3 (#3158)
* Bump dessant/lock-threads from 2.1.2 to 3

Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 2.1.2 to 3.
- [Release notes](https://github.com/dessant/lock-threads/releases)
- [Changelog](https://github.com/dessant/lock-threads/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dessant/lock-threads/compare/v2.1.2...v3)

---
updated-dependencies:
- dependency-name: dessant/lock-threads
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Adjust config for breaking change

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ludeeus <ludeeus@ludeeus.dev>
2021-09-28 09:41:20 +02:00
Joakim Sørensen
bb991b69bb Bmp frontend to b6344eb6 (#3161) 2021-09-28 09:33:38 +02:00
Pascal Vizeli
7c9f6067c0 Fix pyupgrade precommit (#3155)
* Fix pyupgrade precommit

* address comments
2021-09-27 11:05:21 +02:00
dependabot[bot]
e960a70217 Bump pyupgrade from 2.26.0.post1 to 2.28.0 (#3151)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-27 10:37:21 +02:00
dependabot[bot]
9b0a2e6da9 Bump sentry-sdk from 1.4.0 to 1.4.1 (#3140)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-27 10:36:58 +02:00
Joakim Sørensen
cd0c151bd9 Fix typo in vcn_version (#3154) 2021-09-27 10:25:03 +02:00
Pascal Vizeli
b03c8c24dd Fix UnboundLocalError (#3153) 2021-09-27 09:44:15 +02:00
Pascal Vizeli
4416b6524e Bump voluptuous from 0.12.1 to 0.12.2 (#3147) 2021-09-27 08:28:34 +02:00
dependabot[bot]
c9d3f65cc8 Bump home-assistant/builder from 2021.07.0 to 2021.09.0 (#3150)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-27 08:07:28 +02:00
Pascal Vizeli
0407122fbe Revert "Bump voluptuous from 0.12.1 to 0.12.2 (#3141)" (#3145)
This reverts commit 5e871d9399.
2021-09-25 14:50:01 +02:00
dependabot[bot]
5e871d9399 Bump voluptuous from 0.12.1 to 0.12.2 (#3141)
Bumps [voluptuous](https://github.com/alecthomas/voluptuous) from 0.12.1 to 0.12.2.
- [Release notes](https://github.com/alecthomas/voluptuous/releases)
- [Changelog](https://github.com/alecthomas/voluptuous/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alecthomas/voluptuous/compare/0.12.1...v0.12.2)

---
updated-dependencies:
- dependency-name: voluptuous
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-25 11:02:48 +02:00
Joakim Sørensen
6df7a88666 Bump frontend to 03dc3e52 (#3142) 2021-09-25 10:59:53 +02:00
788 changed files with 11422 additions and 11481 deletions

View File

@@ -1,64 +0,0 @@
FROM mcr.microsoft.com/vscode/devcontainers/python:0-3.9
ENV \
DEBIAN_FRONTEND=noninteractive \
VCN_VERSION=0.9.8
SHELL ["/bin/bash", "-c"]
WORKDIR /workspaces
# Set Docker daemon config
RUN \
mkdir -p /etc/docker \
&& echo '{"storage-driver": "vfs"}' > /etc/docker/daemon.json
# Install Node/Yarn for Frontent
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& apt-get update \
&& apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
apt-utils \
apt-transport-https \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
&& apt-get update && apt-get install -y --no-install-recommends \
nodejs \
yarn \
&& curl -o - https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \
&& rm -rf /var/lib/apt/lists/*
ENV NVM_DIR /root/.nvm
# Install docker
# https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
gpg-agent \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
&& add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
&& apt-get update && apt-get install -y --no-install-recommends \
docker-ce \
docker-ce-cli \
containerd.io \
&& rm -rf /var/lib/apt/lists/*
# Install tools
RUN apt-get update && apt-get install -y --no-install-recommends \
jq \
dbus \
network-manager \
apparmor-utils \
libpulse0 \
&& curl -Lo /bin/vcn https://github.com/codenotary/vcn/releases/download/${VCN_VERSION}/vcn-${VCN_VERSION}-linux-amd64-static \
&& chmod a+x /bin/vcn \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies from requirements.txt if it exists
COPY requirements.txt requirements_tests.txt ./
RUN pip3 install -U setuptools pip \
&& pip3 install -r requirements.txt -r requirements_tests.txt \
&& pip3 install tox \
&& rm -f requirements.txt requirements_tests.txt

View File

@@ -1,11 +1,9 @@
{ {
"name": "Supervisor dev", "name": "Supervisor dev",
"context": "..", "image": "ghcr.io/home-assistant/devcontainer:supervisor",
"dockerFile": "Dockerfile", "appPort": ["9123:8123", "7357:4357"],
"appPort": "9123:8123", "postCreateCommand": "bash devcontainer_bootstrap",
"postCreateCommand": "pre-commit install",
"runArgs": ["-e", "GIT_EDITOR=code --wait", "--privileged"], "runArgs": ["-e", "GIT_EDITOR=code --wait", "--privileged"],
"containerEnv": { "NVM_DIR": "/usr/local/share/nvm" },
"extensions": [ "extensions": [
"ms-python.python", "ms-python.python",
"ms-python.vscode-pylance", "ms-python.vscode-pylance",
@@ -13,7 +11,12 @@
"esbenp.prettier-vscode" "esbenp.prettier-vscode"
], ],
"settings": { "settings": {
"terminal.integrated.shell.linux": "/bin/bash", "terminal.integrated.profiles.linux": {
"zsh": {
"path": "/usr/bin/zsh"
}
},
"terminal.integrated.defaultProfile.linux": "zsh",
"editor.formatOnPaste": false, "editor.formatOnPaste": false,
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.formatOnType": true, "editor.formatOnType": true,

View File

@@ -27,7 +27,7 @@ on:
paths: paths:
- "rootfs/**" - "rootfs/**"
- "supervisor/**" - "supervisor/**"
- build.json - build.yaml
- Dockerfile - Dockerfile
- requirements.txt - requirements.txt
- setup.py - setup.py
@@ -49,7 +49,7 @@ jobs:
requirements: ${{ steps.requirements.outputs.changed }} requirements: ${{ steps.requirements.outputs.changed }}
steps: steps:
- name: Checkout the repository - name: Checkout the repository
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -84,7 +84,7 @@ jobs:
arch: ${{ fromJson(needs.init.outputs.architectures) }} arch: ${{ fromJson(needs.init.outputs.architectures) }}
steps: steps:
- name: Checkout the repository - name: Checkout the repository
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -109,14 +109,14 @@ jobs:
- name: Login to DockerHub - name: Login to DockerHub
if: needs.init.outputs.publish == 'true' if: needs.init.outputs.publish == 'true'
uses: docker/login-action@v1.10.0 uses: docker/login-action@v1.12.0
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
if: needs.init.outputs.publish == 'true' if: needs.init.outputs.publish == 'true'
uses: docker/login-action@v1.10.0 uses: docker/login-action@v1.12.0
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} username: ${{ github.repository_owner }}
@@ -127,15 +127,15 @@ jobs:
run: echo "BUILD_ARGS=--test" >> $GITHUB_ENV run: echo "BUILD_ARGS=--test" >> $GITHUB_ENV
- name: Build supervisor - name: Build supervisor
uses: home-assistant/builder@2021.07.0 uses: home-assistant/builder@2021.12.0
with: with:
args: | args: |
$BUILD_ARGS \ $BUILD_ARGS \
--${{ matrix.arch }} \ --${{ matrix.arch }} \
--target /data \ --target /data \
--with-codenotary "${{ secrets.VCN_USER }}" "${{ secrets.VCN_PASSWORD }}" "${{ secrets.VCN_ORG }}" \
--validate-from "${{ secrets.VCN_ORG }}" \
--generic ${{ needs.init.outputs.version }} --generic ${{ needs.init.outputs.version }}
env:
CAS_API_KEY: ${{ secrets.CAS_TOKEN }}
codenotary: codenotary:
name: CodeNotary signature name: CodeNotary signature
@@ -144,7 +144,7 @@ jobs:
steps: steps:
- name: Checkout the repository - name: Checkout the repository
if: needs.init.outputs.publish == 'true' if: needs.init.outputs.publish == 'true'
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
with: with:
fetch-depth: 0 fetch-depth: 0
@@ -170,7 +170,7 @@ jobs:
steps: steps:
- name: Checkout the repository - name: Checkout the repository
if: needs.init.outputs.publish == 'true' if: needs.init.outputs.publish == 'true'
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Initialize git - name: Initialize git
if: needs.init.outputs.publish == 'true' if: needs.init.outputs.publish == 'true'
@@ -195,11 +195,11 @@ jobs:
timeout-minutes: 60 timeout-minutes: 60
steps: steps:
- name: Checkout the repository - name: Checkout the repository
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Build the Supervisor - name: Build the Supervisor
if: needs.init.outputs.publish != 'true' if: needs.init.outputs.publish != 'true'
uses: home-assistant/builder@2021.07.0 uses: home-assistant/builder@2021.12.0
with: with:
args: | args: |
--test \ --test \
@@ -219,7 +219,7 @@ jobs:
docker create --name hassio_supervisor \ docker create --name hassio_supervisor \
--privileged \ --privileged \
--security-opt seccomp=unconfined \ --security-opt seccomp=unconfined \
--security-opt apparmor:unconfined \ --security-opt apparmor=unconfined \
-v /run/docker.sock:/run/docker.sock \ -v /run/docker.sock:/run/docker.sock \
-v /run/dbus:/run/dbus \ -v /run/dbus:/run/dbus \
-v /tmp/supervisor/data:/data \ -v /tmp/supervisor/data:/data \

View File

@@ -23,22 +23,19 @@ jobs:
name: Prepare Python ${{ matrix.python-version }} dependencies name: Prepare Python ${{ matrix.python-version }} dependencies
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
id: python id: python
uses: actions/setup-python@v2.2.2 uses: actions/setup-python@v2.3.1
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: venv path: venv
key: | key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }} ${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
restore-keys: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-
- name: Create Python virtual environment - name: Create Python virtual environment
if: steps.cache-venv.outputs.cache-hit != 'true' if: steps.cache-venv.outputs.cache-hit != 'true'
run: | run: |
@@ -48,7 +45,7 @@ jobs:
pip install -r requirements.txt -r requirements_tests.txt pip install -r requirements.txt -r requirements_tests.txt
- name: Restore pre-commit environment from cache - name: Restore pre-commit environment from cache
id: cache-precommit id: cache-precommit
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: ${{ env.PRE_COMMIT_HOME }} path: ${{ env.PRE_COMMIT_HOME }}
key: | key: |
@@ -67,15 +64,15 @@ jobs:
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2 uses: actions/setup-python@v2.3.1
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: venv path: venv
key: | key: |
@@ -96,7 +93,7 @@ jobs:
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Register hadolint problem matcher - name: Register hadolint problem matcher
run: | run: |
echo "::add-matcher::.github/workflows/matchers/hadolint.json" echo "::add-matcher::.github/workflows/matchers/hadolint.json"
@@ -111,15 +108,15 @@ jobs:
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2 uses: actions/setup-python@v2.3.1
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: venv path: venv
key: | key: |
@@ -131,7 +128,7 @@ jobs:
exit 1 exit 1
- name: Restore pre-commit environment from cache - name: Restore pre-commit environment from cache
id: cache-precommit id: cache-precommit
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: ${{ env.PRE_COMMIT_HOME }} path: ${{ env.PRE_COMMIT_HOME }}
key: | key: |
@@ -155,15 +152,15 @@ jobs:
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2 uses: actions/setup-python@v2.3.1
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: venv path: venv
key: | key: |
@@ -187,15 +184,15 @@ jobs:
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2 uses: actions/setup-python@v2.3.1
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: venv path: venv
key: | key: |
@@ -207,7 +204,7 @@ jobs:
exit 1 exit 1
- name: Restore pre-commit environment from cache - name: Restore pre-commit environment from cache
id: cache-precommit id: cache-precommit
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: ${{ env.PRE_COMMIT_HOME }} path: ${{ env.PRE_COMMIT_HOME }}
key: | key: |
@@ -228,15 +225,15 @@ jobs:
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2 uses: actions/setup-python@v2.3.1
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: venv path: venv
key: | key: |
@@ -248,7 +245,7 @@ jobs:
exit 1 exit 1
- name: Restore pre-commit environment from cache - name: Restore pre-commit environment from cache
id: cache-precommit id: cache-precommit
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: ${{ env.PRE_COMMIT_HOME }} path: ${{ env.PRE_COMMIT_HOME }}
key: | key: |
@@ -272,15 +269,15 @@ jobs:
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2 uses: actions/setup-python@v2.3.1
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: venv path: venv
key: | key: |
@@ -304,15 +301,15 @@ jobs:
needs: prepare needs: prepare
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2 uses: actions/setup-python@v2.3.1
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: venv path: venv
key: | key: |
@@ -324,7 +321,7 @@ jobs:
exit 1 exit 1
- name: Restore pre-commit environment from cache - name: Restore pre-commit environment from cache
id: cache-precommit id: cache-precommit
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: ${{ env.PRE_COMMIT_HOME }} path: ${{ env.PRE_COMMIT_HOME }}
key: | key: |
@@ -348,19 +345,19 @@ jobs:
name: Run tests Python ${{ matrix.python-version }} name: Run tests Python ${{ matrix.python-version }}
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.2.2 uses: actions/setup-python@v2.3.1
id: python id: python
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: Install VCN tools - name: Install VCN tools
uses: home-assistant/actions/helpers/vcn@master uses: home-assistant/actions/helpers/vcn@master
with: with:
vnc_version: ${{ env.DEFAULT_VCN }} vcn_version: ${{ env.DEFAULT_VCN }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: venv path: venv
key: | key: |
@@ -395,7 +392,7 @@ jobs:
-o console_output_style=count \ -o console_output_style=count \
tests tests
- name: Upload coverage artifact - name: Upload coverage artifact
uses: actions/upload-artifact@v2.2.4 uses: actions/upload-artifact@v2.3.1
with: with:
name: coverage-${{ matrix.python-version }} name: coverage-${{ matrix.python-version }}
path: .coverage path: .coverage
@@ -406,15 +403,15 @@ jobs:
needs: pytest needs: pytest
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }} - name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v2.2.2 uses: actions/setup-python@v2.3.1
id: python id: python
with: with:
python-version: ${{ env.DEFAULT_PYTHON }} python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment - name: Restore Python virtual environment
id: cache-venv id: cache-venv
uses: actions/cache@v2.1.6 uses: actions/cache@v2.1.7
with: with:
path: venv path: venv
key: | key: |

View File

@@ -9,12 +9,12 @@ jobs:
lock: lock:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: dessant/lock-threads@v2.1.2 - uses: dessant/lock-threads@v3
with: with:
github-token: ${{ github.token }} github-token: ${{ github.token }}
issue-lock-inactive-days: "30" issue-inactive-days: "30"
issue-exclude-created-before: "2020-10-01T00:00:00Z" exclude-issue-created-before: "2020-10-01T00:00:00Z"
issue-lock-reason: "" issue-lock-reason: ""
pr-lock-inactive-days: "1" pr-inactive-days: "1"
pr-exclude-created-before: "2020-11-01T00:00:00Z" exclude-pr-created-before: "2020-11-01T00:00:00Z"
pr-lock-reason: "" pr-lock-reason: ""

View File

@@ -11,7 +11,7 @@ jobs:
name: Release Drafter name: Release Drafter
steps: steps:
- name: Checkout the repository - name: Checkout the repository
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
with: with:
fetch-depth: 0 fetch-depth: 0

View File

@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out code from GitHub - name: Check out code from GitHub
uses: actions/checkout@v2.3.4 uses: actions/checkout@v2.4.0
- name: Sentry Release - name: Sentry Release
uses: getsentry/action-release@v1.1.6 uses: getsentry/action-release@v1.1.6
env: env:

View File

@@ -1,13 +1,13 @@
repos: repos:
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 21.9b0 rev: 21.12b0
hooks: hooks:
- id: black - id: black
args: args:
- --safe - --safe
- --quiet - --quiet
- --target-version - --target-version
- py38 - py39
files: ^((supervisor|tests)/.+)?[^/]+\.py$ files: ^((supervisor|tests)/.+)?[^/]+\.py$
- repo: https://gitlab.com/pycqa/flake8 - repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3 rev: 3.8.3
@@ -23,12 +23,12 @@ repos:
- id: check-executables-have-shebangs - id: check-executables-have-shebangs
stages: [manual] stages: [manual]
- id: check-json - id: check-json
- repo: https://github.com/pre-commit/mirrors-isort - repo: https://github.com/PyCQA/isort
rev: v4.3.21 rev: 5.9.3
hooks: hooks:
- id: isort - id: isort
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v2.26.0 rev: v2.31.0
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py39-plus] args: [--py39-plus]

2
.vscode/tasks.json vendored
View File

@@ -4,7 +4,7 @@
{ {
"label": "Run Supervisor", "label": "Run Supervisor",
"type": "shell", "type": "shell",
"command": "./scripts/supervisor.sh", "command": "supervisor_run",
"group": { "group": {
"kind": "test", "kind": "test",
"isDefault": true "isDefault": true

View File

@@ -6,7 +6,6 @@ ENV \
SUPERVISOR_API=http://localhost SUPERVISOR_API=http://localhost
ARG BUILD_ARCH ARG BUILD_ARCH
ARG VCN_VERSION
WORKDIR /usr/src WORKDIR /usr/src
# Install base # Install base
@@ -16,38 +15,10 @@ RUN \
eudev \ eudev \
eudev-libs \ eudev-libs \
git \ git \
glib \
libffi \ libffi \
libpulse \ libpulse \
musl \ musl \
openssl \ openssl
&& apk add --no-cache --virtual .build-dependencies \
build-base \
go \
\
&& git clone -b v${VCN_VERSION} --depth 1 \
https://github.com/codenotary/vcn \
&& cd vcn \
\
&& if [ "${BUILD_ARCH}" = "armhf" ]; then \
GOARM=6 GOARCH=arm go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
elif [ "${BUILD_ARCH}" = "armv7" ]; then \
GOARM=7 GOARCH=arm go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
elif [ "${BUILD_ARCH}" = "aarch64" ]; then \
GOARCH=arm64 go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
elif [ "${BUILD_ARCH}" = "i386" ]; then \
GOARCH=386 go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
elif [ "${BUILD_ARCH}" = "amd64" ]; then \
GOARCH=amd64 go build -o vcn -ldflags="-s -w" ./cmd/vcn; \
else \
exit 1; \
fi \
\
&& rm -rf /root/go /root/.cache \
&& mv vcn /usr/bin/vcn \
\
&& apk del .build-dependencies \
&& rm -rf /usr/src/vcn
# Install requirements # Install requirements
COPY requirements.txt . COPY requirements.txt .

View File

@@ -1,24 +0,0 @@
{
"image": "homeassistant/{arch}-hassio-supervisor",
"shadow_repository": "ghcr.io/home-assistant",
"build_from": {
"aarch64": "ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.14",
"armhf": "ghcr.io/home-assistant/armhf-base-python:3.9-alpine3.14",
"armv7": "ghcr.io/home-assistant/armv7-base-python:3.9-alpine3.14",
"amd64": "ghcr.io/home-assistant/amd64-base-python:3.9-alpine3.14",
"i386": "ghcr.io/home-assistant/i386-base-python:3.9-alpine3.14"
},
"args": {
"VCN_VERSION": "0.9.8"
},
"labels": {
"io.hass.type": "supervisor",
"org.opencontainers.image.title": "Home Assistant Supervisor",
"org.opencontainers.image.description": "Container-based system for managing Home Assistant Core installation",
"org.opencontainers.image.source": "https://github.com/home-assistant/supervisor",
"org.opencontainers.image.authors": "The Home Assistant Authors",
"org.opencontainers.image.url": "https://www.home-assistant.io/",
"org.opencontainers.image.documentation": "https://www.home-assistant.io/docs/",
"org.opencontainers.image.licenses": "Apache License 2.0"
}
}

20
build.yaml Normal file
View File

@@ -0,0 +1,20 @@
image: homeassistant/{arch}-hassio-supervisor
shadow_repository: ghcr.io/home-assistant
build_from:
aarch64: ghcr.io/home-assistant/aarch64-base-python:3.9-alpine3.14
armhf: ghcr.io/home-assistant/armhf-base-python:3.9-alpine3.14
armv7: ghcr.io/home-assistant/armv7-base-python:3.9-alpine3.14
amd64: ghcr.io/home-assistant/amd64-base-python:3.9-alpine3.14
i386: ghcr.io/home-assistant/i386-base-python:3.9-alpine3.14
codenotary:
signer: notary@home-assistant.io
base_image: notary@home-assistant.io
labels:
io.hass.type: supervisor
org.opencontainers.image.title: Home Assistant Supervisor
org.opencontainers.image.description: Container-based system for managing Home Assistant Core installation
org.opencontainers.image.source: https://github.com/home-assistant/supervisor
org.opencontainers.image.authors: The Home Assistant Authors
org.opencontainers.image.url: https://www.home-assistant.io/
org.opencontainers.image.documentation: https://www.home-assistant.io/docs/
org.opencontainers.image.licenses: Apache License 2.0

View File

@@ -1,20 +1,22 @@
aiohttp==3.7.4.post0 aiohttp==3.8.1
async_timeout==3.0.1 async_timeout==4.0.2
atomicwrites==1.4.0 atomicwrites==1.4.0
attrs==21.2.0 attrs==21.2.0
awesomeversion==21.8.1 awesomeversion==22.1.0
brotlipy==0.7.0 brotli==1.0.9
cchardet==2.1.7 cchardet==2.1.7
ciso8601==2.2.0 ciso8601==2.2.0
colorlog==6.4.1 colorlog==6.6.0
cpe==1.2.1 cpe==1.2.1
cryptography==3.4.6 cryptography==36.0.1
debugpy==1.4.3 debugpy==1.5.1
docker==5.0.2 deepmerge==1.0.1
gitpython==3.1.24 docker==5.0.3
jinja2==3.0.1 gitpython==3.1.26
pulsectl==21.9.1 jinja2==3.0.3
pulsectl==21.10.5
pyudev==0.22.0 pyudev==0.22.0
ruamel.yaml==0.15.100 ruamel.yaml==0.17.17
sentry-sdk==1.4.0 sentry-sdk==1.5.2
voluptuous==0.12.1 voluptuous==0.12.2
dbus-next==0.2.3

View File

@@ -1,14 +1,14 @@
black==21.9b0 black==21.12b0
codecov==2.1.12 codecov==2.1.12
coverage==5.5 coverage==6.2
flake8-docstrings==1.6.0 flake8-docstrings==1.6.0
flake8==3.9.2 flake8==4.0.1
pre-commit==2.15.0 pre-commit==2.17.0
pydocstyle==6.1.1 pydocstyle==6.1.1
pylint==2.11.1 pylint==2.12.2
pytest-aiohttp==0.3.0 pytest-aiohttp==0.3.0
pytest-asyncio==0.12.0 # NB!: Versions over 0.12.0 breaks pytest-aiohttp (https://github.com/aio-libs/pytest-aiohttp/issues/16) pytest-asyncio==0.12.0 # NB!: Versions over 0.12.0 breaks pytest-aiohttp (https://github.com/aio-libs/pytest-aiohttp/issues/16)
pytest-cov==2.12.1 pytest-cov==3.0.0
pytest-timeout==1.4.2 pytest-timeout==2.0.2
pytest==6.2.5 pytest==6.2.5
pyupgrade==2.26.0.post1 pyupgrade==2.31.0

View File

@@ -1,61 +0,0 @@
#!/bin/bash
function start_docker() {
local starttime
local endtime
update-alternatives --set iptables /usr/sbin/iptables-legacy || echo "Fails adjust iptables"
update-alternatives --set ip6tables /usr/sbin/iptables-legacy || echo "Fails adjust ip6tables"
echo "Starting docker."
dockerd 2> /dev/null &
DOCKER_PID=$!
echo "Waiting for docker to initialize..."
starttime="$(date +%s)"
endtime="$(date +%s)"
until docker info >/dev/null 2>&1; do
if [[ $((endtime - starttime)) -le $DOCKER_TIMEOUT ]]; then
sleep 1
endtime=$(date +%s)
else
echo "Timeout while waiting for docker to come up"
exit 1
fi
done
echo "Docker was initialized"
}
function stop_docker() {
local starttime
local endtime
echo "Stopping in container docker..."
if [ "$DOCKER_PID" -gt 0 ] && kill -0 "$DOCKER_PID" 2> /dev/null; then
starttime="$(date +%s)"
endtime="$(date +%s)"
# Now wait for it to die
kill "$DOCKER_PID"
while kill -0 "$DOCKER_PID" 2> /dev/null; do
if [[ $((endtime - starttime)) -le $DOCKER_TIMEOUT ]]; then
sleep 1
endtime=$(date +%s)
else
echo "Timeout while waiting for container docker to die"
exit 1
fi
done
else
echo "Your host might have been left with unreleased resources"
fi
}
function cleanup_lastboot() {
if [[ -f /workspaces/test_supervisor/config.json ]]; then
echo "Cleaning up last boot"
cp /workspaces/test_supervisor/config.json /tmp/config.json
jq -rM 'del(.last_boot)' /tmp/config.json > /workspaces/test_supervisor/config.json
rm /tmp/config.json
fi
}

View File

@@ -1,133 +0,0 @@
#!/bin/bash
source "${BASH_SOURCE[0]%/*}/common.sh"
set -eE
DOCKER_TIMEOUT=30
DOCKER_PID=0
function build_supervisor() {
docker pull homeassistant/amd64-builder:dev
docker run --rm \
--privileged \
-v /run/docker.sock:/run/docker.sock \
-v "$(pwd):/data" \
homeassistant/amd64-builder:dev \
--generic latest \
--target /data \
--test \
--amd64 \
--no-cache
}
function cleanup_docker() {
echo "Cleaning up stopped containers..."
docker rm $(docker ps -a -q) || true
}
function run_supervisor() {
mkdir -p /workspaces/test_supervisor
echo "Start Supervisor"
docker run --rm --privileged \
--name hassio_supervisor \
--privileged \
--security-opt seccomp=unconfined \
--security-opt apparmor:unconfined \
-v /run/docker.sock:/run/docker.sock:rw \
-v /run/dbus:/run/dbus:ro \
-v /run/udev:/run/udev:ro \
-v "/workspaces/test_supervisor":/data:rw \
-v /etc/machine-id:/etc/machine-id:ro \
-v /workspaces/supervisor:/usr/src/supervisor \
-e SUPERVISOR_SHARE="/workspaces/test_supervisor" \
-e SUPERVISOR_NAME=hassio_supervisor \
-e SUPERVISOR_DEV=1 \
-e SUPERVISOR_MACHINE="qemux86-64" \
homeassistant/amd64-hassio-supervisor:latest
}
function init_dbus() {
if pgrep dbus-daemon; then
echo "Dbus is running"
return 0
fi
echo "Startup dbus"
mkdir -p /var/lib/dbus
cp -f /etc/machine-id /var/lib/dbus/machine-id
# cleanups
mkdir -p /run/dbus
rm -f /run/dbus/pid
# run
dbus-daemon --system --print-address
}
function init_udev() {
if pgrep systemd-udevd; then
echo "udev is running"
return 0
fi
echo "Startup udev"
# cleanups
mkdir -p /run/udev
# run
/lib/systemd/systemd-udevd --daemon
sleep 3
udevadm trigger && udevadm settle
}
function init_os-agent() {
if pgrep os-agent; then
echo "os-agent is running"
return 0
fi
if [ ! -f /usr/sbin/os-agent ]; then
curl -Lo /usr/sbin/os-agent https://github.com/home-assistant/os-agent/releases/latest/download/os-agent-debian-amd64.bin
curl -Lo /etc/dbus-1/system.d/io.hass.conf https://raw.githubusercontent.com/home-assistant/os-agent/main/contrib/io.hass.conf
chmod a+x /usr/sbin/os-agent
fi
/usr/sbin/os-agent &
}
echo "Run Supervisor"
start_docker
trap "stop_docker" ERR
if [ "$( docker container inspect -f '{{.State.Status}}' hassio_supervisor )" == "running" ]; then
echo "Restarting Supervisor"
docker rm -f hassio_supervisor
init_dbus
init_udev
init_os-agent
cleanup_lastboot
run_supervisor
stop_docker
else
echo "Starting Supervisor"
docker system prune -f
build_supervisor
cleanup_lastboot
cleanup_docker
init_dbus
init_udev
init_os-agent
run_supervisor
stop_docker
fi

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
source "${BASH_SOURCE[0]%/*}/common.sh" source "/etc/supervisor_scripts/common"
set -e set -e

View File

@@ -4,9 +4,8 @@ include_trailing_comma=True
force_grid_wrap=0 force_grid_wrap=0
line_length=88 line_length=88
indent = " " indent = " "
not_skip = __init__.py
force_sort_within_sections = true force_sort_within_sections = true
sections = FUTURE,STDLIB,INBETWEENS,THIRDPARTY,FIRSTPARTY,LOCALFOLDER sections = FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
default_section = THIRDPARTY default_section = THIRDPARTY
forced_separate = tests forced_separate = tests
combine_as_imports = true combine_as_imports = true

View File

@@ -35,7 +35,7 @@ setup(
"supervisor.api", "supervisor.api",
"supervisor.backups", "supervisor.backups",
"supervisor.dbus.network", "supervisor.dbus.network",
"supervisor.dbus.payloads", "supervisor.dbus.network.setting",
"supervisor.dbus", "supervisor.dbus",
"supervisor.discovery.services", "supervisor.discovery.services",
"supervisor.discovery", "supervisor.discovery",

View File

@@ -39,6 +39,7 @@ if __name__ == "__main__":
_LOGGER.info("Initializing Supervisor setup") _LOGGER.info("Initializing Supervisor setup")
coresys = loop.run_until_complete(bootstrap.initialize_coresys()) coresys = loop.run_until_complete(bootstrap.initialize_coresys())
loop.set_debug(coresys.config.debug)
loop.run_until_complete(coresys.core.connect()) loop.run_until_complete(coresys.core.connect())
bootstrap.supervisor_debugger(coresys) bootstrap.supervisor_debugger(coresys)

View File

@@ -158,11 +158,11 @@ class AddonManager(CoreSysAttributes):
store = self.store.get(slug) store = self.store.get(slug)
if not store: if not store:
raise AddonsError(f"Add-on {slug} not exists", _LOGGER.error) raise AddonsError(f"Add-on {slug} does not exist", _LOGGER.error)
if not store.available: if not store.available:
raise AddonsNotSupportedError( raise AddonsNotSupportedError(
f"Add-on {slug} not supported on that platform", _LOGGER.error f"Add-on {slug} not supported on this platform", _LOGGER.error
) )
self.data.install(store) self.data.install(store)
@@ -252,7 +252,7 @@ class AddonManager(CoreSysAttributes):
], ],
on_condition=AddonsJobError, on_condition=AddonsJobError,
) )
async def update(self, slug: str) -> None: async def update(self, slug: str, backup: Optional[bool] = False) -> None:
"""Update add-on.""" """Update add-on."""
if slug not in self.local: if slug not in self.local:
raise AddonsError(f"Add-on {slug} is not installed", _LOGGER.error) raise AddonsError(f"Add-on {slug} is not installed", _LOGGER.error)
@@ -273,6 +273,13 @@ class AddonManager(CoreSysAttributes):
f"Add-on {slug} not supported on that platform", _LOGGER.error f"Add-on {slug} not supported on that platform", _LOGGER.error
) )
if backup:
await self.sys_backups.do_backup_partial(
name=f"addon_{addon.slug}_{addon.version}",
homeassistant=False,
addons=[addon.slug],
)
# Update instance # Update instance
last_state: AddonState = addon.state last_state: AddonState = addon.state
old_image = addon.image old_image = addon.image
@@ -306,22 +313,24 @@ class AddonManager(CoreSysAttributes):
async def rebuild(self, slug: str) -> None: async def rebuild(self, slug: str) -> None:
"""Perform a rebuild of local build add-on.""" """Perform a rebuild of local build add-on."""
if slug not in self.local: if slug not in self.local:
_LOGGER.error("Add-on %s is not installed", slug) raise AddonsError(f"Add-on {slug} is not installed", _LOGGER.error)
raise AddonsError()
addon = self.local[slug] addon = self.local[slug]
if addon.is_detached: if addon.is_detached:
_LOGGER.error("Add-on %s is not available inside store", slug) raise AddonsError(
raise AddonsError() f"Add-on {slug} is not available inside store", _LOGGER.error
)
store = self.store[slug] store = self.store[slug]
# Check if a rebuild is possible now # Check if a rebuild is possible now
if addon.version != store.version: if addon.version != store.version:
_LOGGER.error("Version changed, use Update instead Rebuild") raise AddonsError(
raise AddonsError() "Version changed, use Update instead Rebuild", _LOGGER.error
)
if not addon.need_build: if not addon.need_build:
_LOGGER.error("Can't rebuild a image based add-on") raise AddonsNotSupportedError(
raise AddonsNotSupportedError() "Can't rebuild a image based add-on", _LOGGER.error
)
# remove docker container but not addon config # remove docker container but not addon config
last_state: AddonState = addon.state last_state: AddonState = addon.state

View File

@@ -10,9 +10,10 @@ import secrets
import shutil import shutil
import tarfile import tarfile
from tempfile import TemporaryDirectory from tempfile import TemporaryDirectory
from typing import Any, Awaitable, Optional from typing import Any, Awaitable, Final, Optional
import aiohttp import aiohttp
from deepmerge import Merger
import voluptuous as vol import voluptuous as vol
from voluptuous.humanize import humanize_error from voluptuous.humanize import humanize_error
@@ -87,6 +88,12 @@ RE_OLD_AUDIO = re.compile(r"\d+,\d+")
WATCHDOG_TIMEOUT = aiohttp.ClientTimeout(total=10) WATCHDOG_TIMEOUT = aiohttp.ClientTimeout(total=10)
_OPTIONS_MERGER: Final = Merger(
type_strategies=[(dict, ["merge"])],
fallback_strategies=["override"],
type_conflict_strategies=["override"],
)
class Addon(AddonModel): class Addon(AddonModel):
"""Hold data for add-on inside Supervisor.""" """Hold data for add-on inside Supervisor."""
@@ -112,7 +119,7 @@ class Addon(AddonModel):
if self._state == new_state: if self._state == new_state:
return return
self._state = new_state self._state = new_state
self.sys_homeassistant.websocket.send_command( self.sys_homeassistant.websocket.send_message(
{ {
ATTR_TYPE: WSType.SUPERVISOR_EVENT, ATTR_TYPE: WSType.SUPERVISOR_EVENT,
ATTR_DATA: { ATTR_DATA: {
@@ -194,7 +201,9 @@ class Addon(AddonModel):
@property @property
def options(self) -> dict[str, Any]: def options(self) -> dict[str, Any]:
"""Return options with local changes.""" """Return options with local changes."""
return {**self.data[ATTR_OPTIONS], **self.persist[ATTR_OPTIONS]} return _OPTIONS_MERGER.merge(
deepcopy(self.data[ATTR_OPTIONS]), deepcopy(self.persist[ATTR_OPTIONS])
)
@options.setter @options.setter
def options(self, value: Optional[dict[str, Any]]) -> None: def options(self, value: Optional[dict[str, Any]]) -> None:
@@ -578,7 +587,9 @@ class Addon(AddonModel):
return True return True
# merge options # merge options
options = {**self.persist[ATTR_OPTIONS], **default_options} options = _OPTIONS_MERGER.merge(
deepcopy(default_options), deepcopy(self.persist[ATTR_OPTIONS])
)
# create voluptuous # create voluptuous
new_schema = vol.Schema( new_schema = vol.Schema(
@@ -670,8 +681,9 @@ class Addon(AddonModel):
Return a coroutine. Return a coroutine.
""" """
if not self.with_stdin: if not self.with_stdin:
_LOGGER.error("Add-on %s does not support writing to stdin!", self.slug) raise AddonsNotSupportedError(
raise AddonsNotSupportedError() f"Add-on {self.slug} does not support writing to stdin!", _LOGGER.error
)
try: try:
return await self.instance.write_stdin(data) return await self.instance.write_stdin(data)
@@ -718,17 +730,19 @@ class Addon(AddonModel):
try: try:
write_json_file(temp_path.joinpath("addon.json"), data) write_json_file(temp_path.joinpath("addon.json"), data)
except ConfigurationFileError as err: except ConfigurationFileError as err:
_LOGGER.error("Can't save meta for %s", self.slug) raise AddonsError(
raise AddonsError() from err f"Can't save meta for {self.slug}", _LOGGER.error
) from err
# Store AppArmor Profile # Store AppArmor Profile
if self.sys_host.apparmor.exists(self.slug): if self.sys_host.apparmor.exists(self.slug):
profile = temp_path.joinpath("apparmor.txt") profile = temp_path.joinpath("apparmor.txt")
try: try:
self.sys_host.apparmor.backup_profile(self.slug, profile) await self.sys_host.apparmor.backup_profile(self.slug, profile)
except HostAppArmorError as err: except HostAppArmorError as err:
_LOGGER.error("Can't backup AppArmor profile") raise AddonsError(
raise AddonsError() from err "Can't backup AppArmor profile", _LOGGER.error
) from err
# write into tarfile # write into tarfile
def _write_tarfile(): def _write_tarfile():
@@ -760,8 +774,9 @@ class Addon(AddonModel):
_LOGGER.info("Building backup for add-on %s", self.slug) _LOGGER.info("Building backup for add-on %s", self.slug)
await self.sys_run_in_executor(_write_tarfile) await self.sys_run_in_executor(_write_tarfile)
except (tarfile.TarError, OSError) as err: except (tarfile.TarError, OSError) as err:
_LOGGER.error("Can't write tarfile %s: %s", tar_file, err) raise AddonsError(
raise AddonsError() from err f"Can't write tarfile {tar_file}: {err}", _LOGGER.error
) from err
finally: finally:
if ( if (
is_running is_running
@@ -787,8 +802,9 @@ class Addon(AddonModel):
try: try:
await self.sys_run_in_executor(_extract_tarfile) await self.sys_run_in_executor(_extract_tarfile)
except tarfile.TarError as err: except tarfile.TarError as err:
_LOGGER.error("Can't read tarfile %s: %s", tar_file, err) raise AddonsError(
raise AddonsError() from err f"Can't read tarfile {tar_file}: {err}", _LOGGER.error
) from err
# Read backup data # Read backup data
try: try:
@@ -809,8 +825,10 @@ class Addon(AddonModel):
# If available # If available
if not self._available(data[ATTR_SYSTEM]): if not self._available(data[ATTR_SYSTEM]):
_LOGGER.error("Add-on %s is not available for this platform", self.slug) raise AddonsNotSupportedError(
raise AddonsNotSupportedError() f"Add-on {self.slug} is not available for this platform",
_LOGGER.error,
)
# Restore local add-on information # Restore local add-on information
_LOGGER.info("Restore config for addon %s", self.slug) _LOGGER.info("Restore config for addon %s", self.slug)
@@ -843,7 +861,11 @@ class Addon(AddonModel):
# Restore data # Restore data
def _restore_data(): def _restore_data():
"""Restore data.""" """Restore data."""
shutil.copytree(Path(temp, "data"), self.path_data, symlinks=True) temp_data = Path(temp, "data")
if temp_data.is_dir():
shutil.copytree(temp_data, self.path_data, symlinks=True)
else:
self.path_data.mkdir()
_LOGGER.info("Restoring data for addon %s", self.slug) _LOGGER.info("Restoring data for addon %s", self.slug)
if self.path_data.is_dir(): if self.path_data.is_dir():
@@ -851,8 +873,9 @@ class Addon(AddonModel):
try: try:
await self.sys_run_in_executor(_restore_data) await self.sys_run_in_executor(_restore_data)
except shutil.Error as err: except shutil.Error as err:
_LOGGER.error("Can't restore origin data: %s", err) raise AddonsError(
raise AddonsError() from err f"Can't restore origin data: {err}", _LOGGER.error
) from err
# Restore AppArmor # Restore AppArmor
profile_file = Path(temp, "apparmor.txt") profile_file = Path(temp, "apparmor.txt")

View File

@@ -622,9 +622,9 @@ class AddonModel(CoreSysAttributes, ABC):
"""Uninstall this add-on.""" """Uninstall this add-on."""
return self.sys_addons.uninstall(self.slug) return self.sys_addons.uninstall(self.slug)
def update(self) -> Awaitable[None]: def update(self, backup: Optional[bool] = False) -> Awaitable[None]:
"""Update this add-on.""" """Update this add-on."""
return self.sys_addons.update(self.slug) return self.sys_addons.update(self.slug, backup=backup)
def rebuild(self) -> Awaitable[None]: def rebuild(self) -> Awaitable[None]:
"""Rebuild this add-on.""" """Rebuild this add-on."""

View File

@@ -167,7 +167,7 @@ class AddonOptions(CoreSysAttributes):
device = self.sys_hardware.get_by_path(Path(value)) device = self.sys_hardware.get_by_path(Path(value))
except HardwareNotFound: except HardwareNotFound:
raise vol.Invalid( raise vol.Invalid(
f"Device '{value}' does not exists! in {self._name} ({self._slug})" f"Device '{value}' does not exist in {self._name} ({self._slug})"
) from None ) from None
# Have filter # Have filter

View File

@@ -281,7 +281,7 @@ _SCHEMA_ADDON_CONFIG = vol.Schema(
vol.Optional(ATTR_PANEL_ICON, default="mdi:puzzle"): str, vol.Optional(ATTR_PANEL_ICON, default="mdi:puzzle"): str,
vol.Optional(ATTR_PANEL_TITLE): str, vol.Optional(ATTR_PANEL_TITLE): str,
vol.Optional(ATTR_PANEL_ADMIN, default=True): vol.Boolean(), vol.Optional(ATTR_PANEL_ADMIN, default=True): vol.Boolean(),
vol.Optional(ATTR_HOMEASSISTANT): vol.Maybe(version_tag), vol.Optional(ATTR_HOMEASSISTANT): version_tag,
vol.Optional(ATTR_HOST_NETWORK, default=False): vol.Boolean(), vol.Optional(ATTR_HOST_NETWORK, default=False): vol.Boolean(),
vol.Optional(ATTR_HOST_PID, default=False): vol.Boolean(), vol.Optional(ATTR_HOST_PID, default=False): vol.Boolean(),
vol.Optional(ATTR_HOST_IPC, default=False): vol.Boolean(), vol.Optional(ATTR_HOST_IPC, default=False): vol.Boolean(),

View File

@@ -284,6 +284,10 @@ class RestAPI(CoreSysAttributes):
self.webapp.add_routes( self.webapp.add_routes(
[ [
web.get(
"/supervisor/available_updates", api_supervisor.available_updates
),
web.post("/refresh_updates", api_supervisor.reload),
web.get("/supervisor/ping", api_supervisor.ping), web.get("/supervisor/ping", api_supervisor.ping),
web.get("/supervisor/info", api_supervisor.info), web.get("/supervisor/info", api_supervisor.info),
web.get("/supervisor/stats", api_supervisor.stats), web.get("/supervisor/stats", api_supervisor.stats),

View File

@@ -110,7 +110,7 @@ from .utils import api_process, api_process_raw, api_validate, json_loads
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): vol.Coerce(str)}) SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): str})
# pylint: disable=no-value-for-parameter # pylint: disable=no-value-for-parameter
SCHEMA_OPTIONS = vol.Schema( SCHEMA_OPTIONS = vol.Schema(
@@ -118,8 +118,8 @@ SCHEMA_OPTIONS = vol.Schema(
vol.Optional(ATTR_BOOT): vol.Coerce(AddonBoot), vol.Optional(ATTR_BOOT): vol.Coerce(AddonBoot),
vol.Optional(ATTR_NETWORK): vol.Maybe(docker_ports), vol.Optional(ATTR_NETWORK): vol.Maybe(docker_ports),
vol.Optional(ATTR_AUTO_UPDATE): vol.Boolean(), vol.Optional(ATTR_AUTO_UPDATE): vol.Boolean(),
vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(vol.Coerce(str)), vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(str),
vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(vol.Coerce(str)), vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(str),
vol.Optional(ATTR_INGRESS_PANEL): vol.Boolean(), vol.Optional(ATTR_INGRESS_PANEL): vol.Boolean(),
vol.Optional(ATTR_WATCHDOG): vol.Boolean(), vol.Optional(ATTR_WATCHDOG): vol.Boolean(),
} }
@@ -309,7 +309,7 @@ class APIAddons(CoreSysAttributes):
# Extend schema with add-on specific validation # Extend schema with add-on specific validation
addon_schema = SCHEMA_OPTIONS.extend( addon_schema = SCHEMA_OPTIONS.extend(
{vol.Optional(ATTR_OPTIONS): vol.Any(None, addon.schema)} {vol.Optional(ATTR_OPTIONS): vol.Maybe(addon.schema)}
) )
# Validate/Process Body # Validate/Process Body
@@ -379,8 +379,10 @@ class APIAddons(CoreSysAttributes):
slug: str = request.match_info.get("addon") slug: str = request.match_info.get("addon")
if slug != "self": if slug != "self":
raise APIForbidden("This can be only read by the Add-on itself!") raise APIForbidden("This can be only read by the Add-on itself!")
addon = self._extract_addon_installed(request) addon = self._extract_addon_installed(request)
# Lookup/reload secrets
await self.sys_homeassistant.secrets.reload()
try: try:
return addon.schema.validate(addon.options) return addon.schema.validate(addon.options)
except vol.Invalid: except vol.Invalid:

View File

@@ -56,10 +56,10 @@ SCHEMA_MUTE = vol.Schema(
} }
) )
SCHEMA_DEFAULT = vol.Schema({vol.Required(ATTR_NAME): vol.Coerce(str)}) SCHEMA_DEFAULT = vol.Schema({vol.Required(ATTR_NAME): str})
SCHEMA_PROFILE = vol.Schema( SCHEMA_PROFILE = vol.Schema(
{vol.Required(ATTR_CARD): vol.Coerce(str), vol.Required(ATTR_NAME): vol.Coerce(str)} {vol.Required(ATTR_CARD): str, vol.Required(ATTR_NAME): str}
) )

View File

@@ -23,8 +23,8 @@ _LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_PASSWORD_RESET = vol.Schema( SCHEMA_PASSWORD_RESET = vol.Schema(
{ {
vol.Required(ATTR_USERNAME): vol.Coerce(str), vol.Required(ATTR_USERNAME): str,
vol.Required(ATTR_PASSWORD): vol.Coerce(str), vol.Required(ATTR_PASSWORD): str,
} }
) )

View File

@@ -38,27 +38,25 @@ RE_SLUGIFY_NAME = re.compile(r"[^A-Za-z0-9]+")
# pylint: disable=no-value-for-parameter # pylint: disable=no-value-for-parameter
SCHEMA_RESTORE_PARTIAL = vol.Schema( SCHEMA_RESTORE_PARTIAL = vol.Schema(
{ {
vol.Optional(ATTR_PASSWORD): vol.Any(None, vol.Coerce(str)), vol.Optional(ATTR_PASSWORD): vol.Maybe(str),
vol.Optional(ATTR_HOMEASSISTANT): vol.Boolean(), vol.Optional(ATTR_HOMEASSISTANT): vol.Boolean(),
vol.Optional(ATTR_ADDONS): vol.All([vol.Coerce(str)], vol.Unique()), vol.Optional(ATTR_ADDONS): vol.All([str], vol.Unique()),
vol.Optional(ATTR_FOLDERS): vol.All([vol.In(ALL_FOLDERS)], vol.Unique()), vol.Optional(ATTR_FOLDERS): vol.All([vol.In(ALL_FOLDERS)], vol.Unique()),
} }
) )
SCHEMA_RESTORE_FULL = vol.Schema( SCHEMA_RESTORE_FULL = vol.Schema({vol.Optional(ATTR_PASSWORD): vol.Maybe(str)})
{vol.Optional(ATTR_PASSWORD): vol.Any(None, vol.Coerce(str))}
)
SCHEMA_BACKUP_FULL = vol.Schema( SCHEMA_BACKUP_FULL = vol.Schema(
{ {
vol.Optional(ATTR_NAME): vol.Coerce(str), vol.Optional(ATTR_NAME): str,
vol.Optional(ATTR_PASSWORD): vol.Any(None, vol.Coerce(str)), vol.Optional(ATTR_PASSWORD): vol.Maybe(str),
} }
) )
SCHEMA_BACKUP_PARTIAL = SCHEMA_BACKUP_FULL.extend( SCHEMA_BACKUP_PARTIAL = SCHEMA_BACKUP_FULL.extend(
{ {
vol.Optional(ATTR_ADDONS): vol.All([vol.Coerce(str)], vol.Unique()), vol.Optional(ATTR_ADDONS): vol.All([str], vol.Unique()),
vol.Optional(ATTR_FOLDERS): vol.All([vol.In(ALL_FOLDERS)], vol.Unique()), vol.Optional(ATTR_FOLDERS): vol.All([vol.In(ALL_FOLDERS)], vol.Unique()),
vol.Optional(ATTR_HOMEASSISTANT): vol.Boolean(), vol.Optional(ATTR_HOMEASSISTANT): vol.Boolean(),
} }
@@ -86,6 +84,7 @@ class APIBackups(CoreSysAttributes):
ATTR_NAME: backup.name, ATTR_NAME: backup.name,
ATTR_DATE: backup.date, ATTR_DATE: backup.date,
ATTR_TYPE: backup.sys_type, ATTR_TYPE: backup.sys_type,
ATTR_SIZE: backup.size,
ATTR_PROTECTED: backup.protected, ATTR_PROTECTED: backup.protected,
ATTR_CONTENT: { ATTR_CONTENT: {
ATTR_HOMEASSISTANT: backup.homeassistant_version is not None, ATTR_HOMEASSISTANT: backup.homeassistant_version is not None,

View File

@@ -2,10 +2,14 @@
ATTR_AGENT_VERSION = "agent_version" ATTR_AGENT_VERSION = "agent_version"
ATTR_BOOT_TIMESTAMP = "boot_timestamp" ATTR_BOOT_TIMESTAMP = "boot_timestamp"
ATTR_DATA_DISK = "data_disk"
ATTR_DEVICE = "device" ATTR_DEVICE = "device"
ATTR_DISK_DATA = "disk_data"
ATTR_DT_SYNCHRONIZED = "dt_synchronized" ATTR_DT_SYNCHRONIZED = "dt_synchronized"
ATTR_DT_UTC = "dt_utc" ATTR_DT_UTC = "dt_utc"
ATTR_STARTUP_TIME = "startup_time" ATTR_STARTUP_TIME = "startup_time"
ATTR_USE_NTP = "use_ntp" ATTR_USE_NTP = "use_ntp"
ATTR_USE_RTC = "use_rtc" ATTR_USE_RTC = "use_rtc"
ATTR_APPARMOR_VERSION = "apparmor_version"
ATTR_PANEL_PATH = "panel_path"
ATTR_UPDATE_TYPE = "update_type"
ATTR_AVAILABLE_UPDATES = "available_updates"

View File

@@ -21,7 +21,7 @@ _LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_DOCKER_REGISTRY = vol.Schema( SCHEMA_DOCKER_REGISTRY = vol.Schema(
{ {
vol.Coerce(str): { str: {
vol.Required(ATTR_USERNAME): str, vol.Required(ATTR_USERNAME): str,
vol.Required(ATTR_PASSWORD): str, vol.Required(ATTR_PASSWORD): str,
} }

View File

@@ -10,6 +10,7 @@ from ..const import (
ATTR_ARCH, ATTR_ARCH,
ATTR_AUDIO_INPUT, ATTR_AUDIO_INPUT,
ATTR_AUDIO_OUTPUT, ATTR_AUDIO_OUTPUT,
ATTR_BACKUP,
ATTR_BLK_READ, ATTR_BLK_READ,
ATTR_BLK_WRITE, ATTR_BLK_WRITE,
ATTR_BOOT, ATTR_BOOT,
@@ -43,18 +44,23 @@ _LOGGER: logging.Logger = logging.getLogger(__name__)
SCHEMA_OPTIONS = vol.Schema( SCHEMA_OPTIONS = vol.Schema(
{ {
vol.Optional(ATTR_BOOT): vol.Boolean(), vol.Optional(ATTR_BOOT): vol.Boolean(),
vol.Optional(ATTR_IMAGE): docker_image, vol.Optional(ATTR_IMAGE): vol.Maybe(docker_image),
vol.Optional(ATTR_PORT): network_port, vol.Optional(ATTR_PORT): network_port,
vol.Optional(ATTR_SSL): vol.Boolean(), vol.Optional(ATTR_SSL): vol.Boolean(),
vol.Optional(ATTR_WATCHDOG): vol.Boolean(), vol.Optional(ATTR_WATCHDOG): vol.Boolean(),
vol.Optional(ATTR_WAIT_BOOT): vol.All(vol.Coerce(int), vol.Range(min=60)), vol.Optional(ATTR_WAIT_BOOT): vol.All(vol.Coerce(int), vol.Range(min=60)),
vol.Optional(ATTR_REFRESH_TOKEN): vol.Maybe(vol.Coerce(str)), vol.Optional(ATTR_REFRESH_TOKEN): vol.Maybe(str),
vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(vol.Coerce(str)), vol.Optional(ATTR_AUDIO_OUTPUT): vol.Maybe(str),
vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(vol.Coerce(str)), vol.Optional(ATTR_AUDIO_INPUT): vol.Maybe(str),
} }
) )
SCHEMA_VERSION = vol.Schema({vol.Optional(ATTR_VERSION): version_tag}) SCHEMA_UPDATE = vol.Schema(
{
vol.Optional(ATTR_VERSION): version_tag,
vol.Optional(ATTR_BACKUP): bool,
}
)
class APIHomeAssistant(CoreSysAttributes): class APIHomeAssistant(CoreSysAttributes):
@@ -137,10 +143,14 @@ class APIHomeAssistant(CoreSysAttributes):
@api_process @api_process
async def update(self, request: web.Request) -> None: async def update(self, request: web.Request) -> None:
"""Update Home Assistant.""" """Update Home Assistant."""
body = await api_validate(SCHEMA_VERSION, request) body = await api_validate(SCHEMA_UPDATE, request)
version = body.get(ATTR_VERSION, self.sys_homeassistant.latest_version)
await asyncio.shield(self.sys_homeassistant.core.update(version)) await asyncio.shield(
self.sys_homeassistant.core.update(
version=body.get(ATTR_VERSION, self.sys_homeassistant.latest_version),
backup=body.get(ATTR_BACKUP),
)
)
@api_process @api_process
def stop(self, request: web.Request) -> Awaitable[None]: def stop(self, request: web.Request) -> Awaitable[None]:

View File

@@ -27,6 +27,7 @@ from ..const import (
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from .const import ( from .const import (
ATTR_AGENT_VERSION, ATTR_AGENT_VERSION,
ATTR_APPARMOR_VERSION,
ATTR_BOOT_TIMESTAMP, ATTR_BOOT_TIMESTAMP,
ATTR_DT_SYNCHRONIZED, ATTR_DT_SYNCHRONIZED,
ATTR_DT_UTC, ATTR_DT_UTC,
@@ -38,7 +39,7 @@ from .utils import api_process, api_process_raw, api_validate
SERVICE = "service" SERVICE = "service"
SCHEMA_OPTIONS = vol.Schema({vol.Optional(ATTR_HOSTNAME): vol.Coerce(str)}) SCHEMA_OPTIONS = vol.Schema({vol.Optional(ATTR_HOSTNAME): str})
class APIHost(CoreSysAttributes): class APIHost(CoreSysAttributes):
@@ -49,6 +50,7 @@ class APIHost(CoreSysAttributes):
"""Return host information.""" """Return host information."""
return { return {
ATTR_AGENT_VERSION: self.sys_dbus.agent.version, ATTR_AGENT_VERSION: self.sys_dbus.agent.version,
ATTR_APPARMOR_VERSION: self.sys_host.apparmor.version,
ATTR_CHASSIS: self.sys_host.info.chassis, ATTR_CHASSIS: self.sys_host.info.chassis,
ATTR_CPE: self.sys_host.info.cpe, ATTR_CPE: self.sys_host.info.cpe,
ATTR_DEPLOYMENT: self.sys_host.info.deployment, ATTR_DEPLOYMENT: self.sys_host.info.deployment,

View File

@@ -173,7 +173,7 @@ class SecurityMiddleware(CoreSysAttributes):
# Observer # Observer
if supervisor_token == self.sys_plugins.observer.supervisor_token: if supervisor_token == self.sys_plugins.observer.supervisor_token:
if not OBSERVER_CHECK.match(request.url): if not OBSERVER_CHECK.match(request.path):
_LOGGER.warning("%s invalid Observer access", request.path) _LOGGER.warning("%s invalid Observer access", request.path)
raise HTTPForbidden() raise HTTPForbidden()
_LOGGER.debug("%s access from Observer", request.path) _LOGGER.debug("%s access from Observer", request.path)

View File

@@ -17,7 +17,7 @@ from ..const import (
) )
from ..coresys import CoreSysAttributes from ..coresys import CoreSysAttributes
from ..validate import version_tag from ..validate import version_tag
from .const import ATTR_DEVICE, ATTR_DISK_DATA from .const import ATTR_DATA_DISK, ATTR_DEVICE
from .utils import api_process, api_validate from .utils import api_process, api_validate
_LOGGER: logging.Logger = logging.getLogger(__name__) _LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -38,7 +38,7 @@ class APIOS(CoreSysAttributes):
ATTR_UPDATE_AVAILABLE: self.sys_os.need_update, ATTR_UPDATE_AVAILABLE: self.sys_os.need_update,
ATTR_BOARD: self.sys_os.board, ATTR_BOARD: self.sys_os.board,
ATTR_BOOT: self.sys_dbus.rauc.boot_slot, ATTR_BOOT: self.sys_dbus.rauc.boot_slot,
ATTR_DISK_DATA: self.sys_os.datadisk.disk_used, ATTR_DATA_DISK: self.sys_os.datadisk.disk_used,
} }
@api_process @api_process

View File

@@ -1,14 +1,14 @@
function loadES5() { function loadES5() {
var el = document.createElement('script'); var el = document.createElement('script');
el.src = '/api/hassio/app/frontend_es5/entrypoint.1796fc9b.js'; el.src = '/api/hassio/app/frontend_es5/entrypoint.5d40ff8b.js';
document.body.appendChild(el); document.body.appendChild(el);
} }
if (/.*Version\/(?:11|12)(?:\.\d+)*.*Safari\//.test(navigator.userAgent)) { if (/.*Version\/(?:11|12)(?:\.\d+)*.*Safari\//.test(navigator.userAgent)) {
loadES5(); loadES5();
} else { } else {
try { try {
new Function("import('/api/hassio/app/frontend_latest/entrypoint.5a9040a4.js')")(); new Function("import('/api/hassio/app/frontend_latest/entrypoint.f09e9f8e.js')")();
} catch (err) { } catch (err) {
loadES5(); loadES5();
} }

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"02e63dc5.js","sources":["webpack://home-assistant-frontend/02e63dc5.js"],"mappings":"AAAA","sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"0ac2c6bb.js","sources":["webpack://home-assistant-frontend/0ac2c6bb.js"],"mappings":"AAAA","sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"0bbd5196.js","sources":["webpack://home-assistant-frontend/0bbd5196.js"],"mappings":";AAAA","sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"0fc60622.js","sources":["webpack://home-assistant-frontend/0fc60622.js"],"mappings":"AAAA","sourceRoot":""}

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"2f1a948c.js","sources":["webpack://home-assistant-frontend/2f1a948c.js"],"mappings":"AAAA","sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"337a39f0.js","sources":["webpack://home-assistant-frontend/337a39f0.js"],"mappings":"AAAA","sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,10 @@
/**
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -1,20 +0,0 @@
/**
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at
http://polymer.github.io/LICENSE.txt The complete set of authors may be found at
http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
*/
/**
@license
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/

View File

@@ -1 +0,0 @@
{"version":3,"file":"5891fe3e.js","sources":["webpack://home-assistant-frontend/5891fe3e.js"],"mappings":";AAAA","sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"61aed66c.js","sources":["webpack://home-assistant-frontend/61aed66c.js"],"mappings":"AAAA","sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"649b5acd.js","sources":["webpack://home-assistant-frontend/649b5acd.js"],"mappings":"AAAA","sourceRoot":""}

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -1,2 +1 @@
!function(){"use strict";var r,t,n={5425:function(r,t,n){var e=n(91107);n(58556);function o(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==n)return;var e,o,u=[],i=!0,a=!1;try{for(n=n.call(r);!(i=(e=n.next()).done)&&(u.push(e.value),!t||u.length!==t);i=!0);}catch(f){a=!0,o=f}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}(r,t)||function(r,t){if(!r)return;if("string"==typeof r)return u(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);"Object"===n&&r.constructor&&(n=r.constructor.name);if("Map"===n||"Set"===n)return Array.from(r);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(r,t)}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(r,t){(null==t||t>r.length)&&(t=r.length);for(var n=0,e=new Array(t);n<t;n++)e[n]=r[n];return e}var i={filterData:function(r,t,n){return n=n.toUpperCase(),r.filter((function(r){return Object.entries(t).some((function(t){var e=o(t,2),u=e[0],i=e[1];return!(!i.filterable||!String(i.filterKey?r[i.valueColumn||u][i.filterKey]:r[i.valueColumn||u]).toUpperCase().includes(n))}))}))},sortData:function(r,t,n,e){return r.sort((function(r,o){var u=1;"desc"===n&&(u=-1);var i=t.filterKey?r[t.valueColumn||e][t.filterKey]:r[t.valueColumn||e],a=t.filterKey?o[t.valueColumn||e][t.filterKey]:o[t.valueColumn||e];return"string"==typeof i&&(i=i.toUpperCase()),"string"==typeof a&&(a=a.toUpperCase()),void 0===i&&void 0!==a?1:void 0===a&&void 0!==i?-1:i<a?-1*u:i>a?1*u:0}))}};(0,e.Jj)(i)}},e={};function o(r){var t=e[r];if(void 0!==t)return t.exports;var u=e[r]={exports:{}};return n[r](u,u.exports,o),u.exports}o.m=n,o.x=function(){var r=o.O(void 0,[354],(function(){return o(5425)}));return r=o.O(r)},r=[],o.O=function(t,n,e,u){if(!n){var i=1/0;for(l=0;l<r.length;l++){n=r[l][0],e=r[l][1],u=r[l][2];for(var a=!0,f=0;f<n.length;f++)(!1&u||i>=u)&&Object.keys(o.O).every((function(r){return o.O[r](n[f])}))?n.splice(f--,1):(a=!1,u<i&&(i=u));a&&(r.splice(l--,1),t=e())}return t}u=u||0;for(var l=r.length;l>0&&r[l-1][2]>u;l--)r[l]=r[l-1];r[l]=[n,e,u]},o.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(t,{a:t}),t},o.d=function(r,t){for(var n in t)o.o(t,n)&&!o.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[n]})},o.f={},o.e=function(r){return Promise.all(Object.keys(o.f).reduce((function(t,n){return o.f[n](r,t),t}),[]))},o.u=function(r){return"6de58640.js"},o.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},o.p="/api/hassio/app/frontend_es5/",function(){var r={477:1,425:1};o.f.i=function(t,n){r[t]||importScripts(o.p+o.u(t))};var t=self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[],n=t.push.bind(t);t.push=function(t){var e=t[0],u=t[1],i=t[2];for(var a in u)o.o(u,a)&&(o.m[a]=u[a]);for(i&&i(o);e.length;)r[e.pop()]=1;n(t)}}(),t=o.x,o.x=function(){return o.e(354).then(t)};o.x()}(); !function(){"use strict";var r,t,n={5425:function(r,t,n){var e=n(93217);n(58556);function o(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var n=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null==n)return;var e,o,u=[],i=!0,a=!1;try{for(n=n.call(r);!(i=(e=n.next()).done)&&(u.push(e.value),!t||u.length!==t);i=!0);}catch(f){a=!0,o=f}finally{try{i||null==n.return||n.return()}finally{if(a)throw o}}return u}(r,t)||function(r,t){if(!r)return;if("string"==typeof r)return u(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);"Object"===n&&r.constructor&&(n=r.constructor.name);if("Map"===n||"Set"===n)return Array.from(r);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(r,t)}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(r,t){(null==t||t>r.length)&&(t=r.length);for(var n=0,e=new Array(t);n<t;n++)e[n]=r[n];return e}var i={filterData:function(r,t,n){return n=n.toUpperCase(),r.filter((function(r){return Object.entries(t).some((function(t){var e=o(t,2),u=e[0],i=e[1];return!(!i.filterable||!String(i.filterKey?r[i.valueColumn||u][i.filterKey]:r[i.valueColumn||u]).toUpperCase().includes(n))}))}))},sortData:function(r,t,n,e){return r.sort((function(r,o){var u=1;"desc"===n&&(u=-1);var i=t.filterKey?r[t.valueColumn||e][t.filterKey]:r[t.valueColumn||e],a=t.filterKey?o[t.valueColumn||e][t.filterKey]:o[t.valueColumn||e];return"string"==typeof i&&(i=i.toUpperCase()),"string"==typeof a&&(a=a.toUpperCase()),void 0===i&&void 0!==a?1:void 0===a&&void 0!==i?-1:i<a?-1*u:i>a?1*u:0}))}};(0,e.Jj)(i)}},e={};function o(r){var t=e[r];if(void 0!==t)return t.exports;var u=e[r]={exports:{}};return n[r](u,u.exports,o),u.exports}o.m=n,o.x=function(){var r=o.O(void 0,[191],(function(){return o(5425)}));return r=o.O(r)},r=[],o.O=function(t,n,e,u){if(!n){var i=1/0;for(c=0;c<r.length;c++){n=r[c][0],e=r[c][1],u=r[c][2];for(var a=!0,f=0;f<n.length;f++)(!1&u||i>=u)&&Object.keys(o.O).every((function(r){return o.O[r](n[f])}))?n.splice(f--,1):(a=!1,u<i&&(i=u));if(a){r.splice(c--,1);var l=e();void 0!==l&&(t=l)}}return t}u=u||0;for(var c=r.length;c>0&&r[c-1][2]>u;c--)r[c]=r[c-1];r[c]=[n,e,u]},o.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(t,{a:t}),t},o.d=function(r,t){for(var n in t)o.o(t,n)&&!o.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:t[n]})},o.f={},o.e=function(r){return Promise.all(Object.keys(o.f).reduce((function(t,n){return o.f[n](r,t),t}),[]))},o.u=function(r){return"2dbdaab4.js"},o.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},o.p="/api/hassio/app/frontend_es5/",function(){var r={477:1,425:1};o.f.i=function(t,n){r[t]||importScripts(o.p+o.u(t))};var t=self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[],n=t.push.bind(t);t.push=function(t){var e=t[0],u=t[1],i=t[2];for(var a in u)o.o(u,a)&&(o.m[a]=u[a]);for(i&&i(o);e.length;)r[e.pop()]=1;n(t)}}(),t=o.x,o.x=function(){return o.e(191).then(t)};o.x()}();
//# sourceMappingURL=8849adea.js.map

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"6de58640.js","sources":["webpack://home-assistant-frontend/6de58640.js"],"mappings":"AAAA","sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"71906b61.js","sources":["webpack://home-assistant-frontend/71906b61.js"],"mappings":"AAAA","sourceRoot":""}

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More