Compare commits

...

110 Commits

Author SHA1 Message Date
dependabot[bot]
c634cc1f34 Bump dbus-fast from 1.17.0 to 1.24.0 (#3921)
* Bump dbus-fast from 1.17.0 to 1.23.0

Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.17.0 to 1.23.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.17.0...v1.23.0)

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

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

* Bump to 1.24.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-10-04 19:03:22 -04:00
dependabot[bot]
646725bb08 Bump pyupgrade from 2.38.2 to 3.0.0 (#3922)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.38.2 to 3.0.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.38.2...v3.0.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-04 14:32:37 -04:00
Mike Degatano
618c89c4d8 Don't sync unmanaged interfaces (#3925) 2022-10-04 20:17:30 +02:00
dependabot[bot]
0dc442d0cb Bump actions/cache from 3.0.9 to 3.0.10 (#3920)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.9 to 3.0.10.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.9...v3.0.10)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-04 11:50:58 -04:00
dependabot[bot]
6ae664b448 Bump sentry-sdk from 1.9.9 to 1.9.10 (#3923)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.9 to 1.9.10.
- [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.9.9...1.9.10)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-04 11:49:18 -04:00
Pascal Vizeli
18b43ce767 Catch OS-Error (#3924) 2022-10-04 11:48:53 -04:00
Pascal Vizeli
f9b474866b Adjust stale bot (#3915) 2022-10-03 10:14:54 -04:00
dependabot[bot]
1a76035682 Bump actions/cache from 3.0.8 to 3.0.9 (#3912)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.8 to 3.0.9.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.8...v3.0.9)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-30 11:23:02 +02:00
dependabot[bot]
e332f4b2bd Bump coverage from 6.4.4 to 6.5.0 (#3914)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 6.4.4 to 6.5.0.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/6.4.4...6.5.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-30 11:22:54 +02:00
dependabot[bot]
ab27fd7b57 Bump time-machine from 2.8.1 to 2.8.2 (#3913)
Bumps [time-machine](https://github.com/adamchainz/time-machine) from 2.8.1 to 2.8.2.
- [Release notes](https://github.com/adamchainz/time-machine/releases)
- [Changelog](https://github.com/adamchainz/time-machine/blob/main/HISTORY.rst)
- [Commits](https://github.com/adamchainz/time-machine/compare/2.8.1...2.8.2)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-30 11:22:44 +02:00
dependabot[bot]
12c0faf803 Bump dbus-fast from 1.15.1 to 1.17.0 (#3907)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.15.1 to 1.17.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.15.1...v1.17.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-29 12:18:15 -04:00
Mike Degatano
c0a409b25f No unpack variants for property sets (#3911) 2022-09-29 18:13:02 +02:00
dependabot[bot]
2be33a80a7 Bump pytest-cov from 3.0.0 to 4.0.0 (#3909)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-29 10:06:08 +02:00
Mike Degatano
d684aab207 Addon version shouldn't rely on io.hass.version (#3906)
* Addon version doesn't rely on `io.hass.version`

* Legacy and non-legacy match so remove the if
2022-09-27 21:43:42 +02:00
Mike Degatano
ec6da7851e Bump HA timeout to match S6_SERVICES_GRACETIME (#3904) 2022-09-27 18:55:18 +02:00
dependabot[bot]
eb621f6a2c Bump sentry-sdk from 1.9.8 to 1.9.9 (#3903)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.8 to 1.9.9.
- [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.9.8...1.9.9)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-27 08:41:24 +02:00
Mike Degatano
a1a9c55542 Manual stop true after a reboot (#3902)
* Manual stop true after a reboot

* Fix test
2022-09-27 08:40:55 +02:00
Mike Degatano
d15a7c27ca Don't disconnect in executor (#3901)
* Don't disconnect in executor

* DBus disconnect doesn't raise

* Separate shutdown and disconnect

* pylint fix

* noop coroutine and test
2022-09-27 08:33:28 +02:00
Mike Degatano
fb46335d16 Bump dbus-fast from 1.14.0 to 1.15.1 (#3899) 2022-09-26 20:26:25 -04:00
Mike Degatano
48e666e1fc Bad introspection causes DBus error not KeyError (#3898)
* Bad introspection causes DBus error not KeyError

* Fix none error on disconnect race
2022-09-26 18:27:08 +02:00
dependabot[bot]
ff462ae976 Bump dbus-fast from 1.7.0 to 1.14.0 (#3897)
Bumps [dbus-fast](https://github.com/bluetooth-devices/dbus-fast) from 1.7.0 to 1.14.0.
- [Release notes](https://github.com/bluetooth-devices/dbus-fast/releases)
- [Changelog](https://github.com/Bluetooth-Devices/dbus-fast/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bluetooth-devices/dbus-fast/compare/v1.7.0...v1.14.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-26 11:01:31 -04:00
dependabot[bot]
23731d9a6e Bump pyupgrade from 2.38.0 to 2.38.2 (#3896)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.38.0 to 2.38.2.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.38.0...v2.38.2)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-26 11:31:34 +02:00
Mike Degatano
30df8ce5c7 Attach event monitor after addon restore (#3893)
* Attach event monitor after addon restore

* Load after install and listener removal
2022-09-23 21:11:36 +02:00
Mike Degatano
951efd6b29 Replace __del__ with explicit disconnect (#3892) 2022-09-23 10:28:16 +02:00
Pascal Vizeli
262fd05c6d Add portainer as container orchestra (#3889) 2022-09-22 11:12:37 -04:00
Mike Degatano
2a6fc512e7 Check if issue in list, not end of list in test (#3891)
* Check if issue in list, not end of list

* Similar fix to other test
2022-09-22 16:52:07 +02:00
dependabot[bot]
bb0d89f8fd Bump aiohttp from 3.8.2 to 3.8.3 (#3888)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.8.2 to 3.8.3.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.8.2...v3.8.3)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-22 10:44:43 +02:00
dependabot[bot]
e9ccc7ee19 Bump actions/stale from 5.2.0 to 6.0.0 (#3887)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-22 09:49:54 +02:00
Mike Degatano
a5103cc329 Add restart policy evaluation (#3886)
* Add restart policy evaluation

* No container meta does not fail evaluation
2022-09-22 09:16:33 +02:00
Mike Degatano
c24b811180 Use dbus-fast unpack_variants option (#3885)
* Use dbus-fast unpack_variants option

* More readable log on signals
2022-09-21 20:52:06 +02:00
dependabot[bot]
611963f5dd Bump aiohttp from 3.8.1 to 3.8.2 (#3883)
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.8.1 to 3.8.2.
- [Release notes](https://github.com/aio-libs/aiohttp/releases)
- [Changelog](https://github.com/aio-libs/aiohttp/blob/v3.8.2/CHANGES.rst)
- [Commits](https://github.com/aio-libs/aiohttp/compare/v3.8.1...v3.8.2)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-21 09:24:40 +02:00
Mike Degatano
0958cd0c06 Switch from dbus-next to dbus-fast (#3882)
* Switch to dbus-fast

* dbus-fast==1.6.0
2022-09-21 09:24:04 +02:00
dependabot[bot]
c406814794 Bump pylint from 2.15.2 to 2.15.3 (#3880)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.15.2 to 2.15.3.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.15.2...v2.15.3)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-20 17:39:07 +02:00
dependabot[bot]
c3459fd32a Bump codecov/codecov-action from 3.1.0 to 3.1.1 (#3879)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-20 16:22:28 +02:00
Mike Degatano
2072370ccc Revert "Switch to dbus-fast (#3877)" (#3878)
This reverts commit 615758a1df.
2022-09-19 17:18:25 -04:00
Mike Degatano
615758a1df Switch to dbus-fast (#3877) 2022-09-19 21:55:22 +02:00
Mike Degatano
cd10b597dd Empty string in gateway returns none (#3873) 2022-09-17 16:24:56 +02:00
dependabot[bot]
50c277137d Bump pylint from 2.14.5 to 2.15.2 (#3849)
* Bump pylint from 2.14.5 to 2.15.2

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.14.5 to 2.15.2.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.14.5...v2.15.2)

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

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

* fix unspecified-encoding pylint errors

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-09-17 09:56:03 +02:00
Mike Degatano
99bc201688 Listen for dbus property changes (#3872)
* Listen for dbus property changes

* Avoid remaking dbus proxy objects

* proper snake case for pylint

* some cleanup and more tests
2022-09-17 09:55:41 +02:00
dependabot[bot]
0b09eb3659 Bump actions/stale from 5.1.1 to 5.2.0 (#3867)
Bumps [actions/stale](https://github.com/actions/stale) from 5.1.1 to 5.2.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v5.1.1...v5.2.0)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 15:28:08 -04:00
dependabot[bot]
a6795536ad Bump pyupgrade from 2.37.3 to 2.38.0 (#3870)
Bumps [pyupgrade](https://github.com/asottile/pyupgrade) from 2.37.3 to 2.38.0.
- [Release notes](https://github.com/asottile/pyupgrade/releases)
- [Commits](https://github.com/asottile/pyupgrade/compare/v2.37.3...v2.38.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 15:27:42 -04:00
dependabot[bot]
a46536e9be Bump awesomeversion from 22.8.0 to 22.9.0 (#3871)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 08:20:37 +02:00
dependabot[bot]
c01bed9d97 Bump release-drafter/release-drafter from 5.20.1 to 5.21.0 (#3869)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-16 08:20:09 +02:00
Pascal Vizeli
2f4e06aadf Only update HW condition at once (#3868)
* Only update HW condition at once

* extend logging
2022-09-15 22:18:14 +02:00
Mike Degatano
b8249548ae Fix network vlan api (#3865) 2022-09-13 21:23:13 +02:00
Mike Degatano
5f98ab7e3e Reduce patching call dbus in tests (#3866) 2022-09-13 21:22:15 +02:00
Mike Degatano
d195f19fa8 Refactor to dbus-next proxy interfaces (#3862)
* Refactor to dbus-next proxy interfaces

* Fix tests mocking dbus methods

* Fix call dbus
2022-09-13 13:45:28 -04:00
Joakim Sørensen
c67d4d7c0b Cleanup evaluations (#3857)
* Cleanup

* move

* Add OS available test

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-09-13 13:19:07 -04:00
Joakim Sørensen
5aa8028ff5 Use the same python version for all steps (#3864) 2022-09-13 19:03:57 +02:00
Mike Degatano
b71c6c60da Share MessageBus across dbus objects (#3860)
* Share MessageBus across dbus objects

* Fix connect calls in tests
2022-09-12 20:10:12 +02:00
Mike Degatano
4f272ad4fd Dbus refactor and tests (#3854)
* Dbus refactor and tests

* Link to timedate introspection
2022-09-12 11:59:56 -04:00
dependabot[bot]
611128c014 Bump home-assistant/builder from 2022.07.0 to 2022.09.0 (#3852)
Bumps [home-assistant/builder](https://github.com/home-assistant/builder) from 2022.07.0 to 2022.09.0.
- [Release notes](https://github.com/home-assistant/builder/releases)
- [Commits](https://github.com/home-assistant/builder/compare/2022.07.0...2022.09.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-10 08:54:25 -04:00
Pascal Vizeli
cbf73ceaa3 Bump supported docker version (#3853)
* Bump supported docker version

* Update supervisor/docker/manager.py

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

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2022-09-10 08:53:25 -04:00
Stefan Agner
01e24a3e74 Replace loop test fixture with event_loop (#3847)
This addresses a deprecation warning when calling tests with Python
3.10:

```
../python3.10/site-packages/pytest_aiohttp/plugin.py:33: DeprecationWarning: 'loop' fixture is deprecated and scheduled for removal, please use 'event_loop' instead
```
2022-09-09 09:54:57 -04:00
dependabot[bot]
10dcf5c12f Bump cryptography from 37.0.4 to 38.0.1 (#3850)
Bumps [cryptography](https://github.com/pyca/cryptography) from 37.0.4 to 38.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/37.0.4...38.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>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-08 11:21:00 +02:00
Mike Degatano
ebae1e70ee Add tests for backups check (#3845) 2022-09-07 10:33:46 +02:00
dependabot[bot]
b1ddb917c8 Bump sentry-sdk from 1.9.7 to 1.9.8 (#3843)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.7 to 1.9.8.
- [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.9.7...1.9.8)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-06 18:13:33 +02:00
dependabot[bot]
d6c25c4188 Bump pytest from 7.1.2 to 7.1.3 (#3842)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.1.2 to 7.1.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/7.1.2...7.1.3)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-06 18:13:22 +02:00
Joakim Sørensen
170e85396e Add missing await in backup check (#3844) 2022-09-06 12:24:27 +02:00
Mike Degatano
bf48d48c51 Create issue+suggestion when no recent backup (#3814)
* Automatic full backup option

* Fix test for change in free space check

* Suggestions only, no automation

* Remove extra in backup config schema
2022-09-03 09:50:23 +02:00
Mike Degatano
fc646db95f Reduce connectivity checks (#3836)
* Reduce connectivity checks

* Fix/remove connectivity tests

* Remove throttle from prior connectivity tests

* Use dbus_property wrapper

* Allow variable throttle period with lambda

* Add evaluation for connectivity check disabled
2022-09-03 09:48:30 +02:00
dependabot[bot]
0769af9383 Bump sentry-sdk from 1.9.6 to 1.9.7 (#3840)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.6 to 1.9.7.
- [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.9.6...1.9.7)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-02 13:30:55 -04:00
Mike Degatano
1f28e6ad93 Fire issue events on HA's bus (#3837)
* Fire issue events on HA's bus

* Convey event type with event field

* Message for humans
2022-09-02 17:40:10 +02:00
Marco Trevisan
2dab39bf90 supervisor/backup: Ensure compressed flag is respected by homeassistant (#3839)
As per commit 80e67b3 we're supporting a compressed flag on backups to
define whether a tar archive should be fully compressed or not, but
while we respect this for all the addons and folders we don't do it for
the actual homeassistant archive, that is always compressed despite the
passed flag.

Fix this by applying the same logic to the homeassistant archive too.
2022-09-02 09:21:33 +02:00
dependabot[bot]
dcd0592d44 Bump sentry-sdk from 1.9.5 to 1.9.6 (#3835)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.5 to 1.9.6.
- [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.9.5...1.9.6)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 10:51:37 +02:00
dependabot[bot]
7c4b20380e Bump black from 22.6.0 to 22.8.0 (#3834)
Bumps [black](https://github.com/psf/black) from 22.6.0 to 22.8.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.6.0...22.8.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 10:51:19 +02:00
dependabot[bot]
1d304bd6ff Bump colorlog from 6.6.0 to 6.7.0 (#3832)
Bumps [colorlog](https://github.com/borntyping/python-colorlog) from 6.6.0 to 6.7.0.
- [Release notes](https://github.com/borntyping/python-colorlog/releases)
- [Commits](https://github.com/borntyping/python-colorlog/compare/v6.6.0...v6.7.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-30 11:28:04 +02:00
Mike Degatano
4ea27f6311 Network connection check only about ipv4 (#3830)
* Network connection test only about ipv4

* Better test of change being made
2022-08-30 08:39:08 +02:00
Pascal Vizeli
3dc36c3402 Use link-local instead disabled for ipv6 (#3829)
* Use link-local instead disabled for ipv6

* Add a test

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-08-29 16:56:59 -04:00
Mike Degatano
bae7fe4184 Debug info for network connection problem (#3828)
* Debug info for network connection problem

* Update network tests
2022-08-29 22:01:40 +02:00
Mike Degatano
df030e6209 No bool conversion in resolution test (#3826) 2022-08-26 16:42:45 +02:00
Mike Degatano
09d60b4957 Store load ignores supervisor updated condition (#3823) 2022-08-26 10:22:55 +02:00
dependabot[bot]
004065ae33 Bump pyudev from 0.23.2 to 0.24.0 (#3824)
Bumps [pyudev](https://github.com/pyudev/pyudev) from 0.23.2 to 0.24.0.
- [Release notes](https://github.com/pyudev/pyudev/releases)
- [Changelog](https://github.com/pyudev/pyudev/blob/master/CHANGES.rst)
- [Commits](https://github.com/pyudev/pyudev/compare/v0.23.2...v0.24.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-26 09:56:10 +02:00
Mike Degatano
854d337dd3 Bump ruamel.yaml to 0.17.21 (#3821) 2022-08-25 16:33:07 -04:00
Mike Degatano
2c5bb3f714 Fix suggestion test to be order agnostic (#3822) 2022-08-25 16:06:47 -04:00
Pascal Vizeli
7b63544474 Simplify watchdog container rules (#3820) 2022-08-25 15:20:14 -04:00
Joakim Sørensen
97af1fc66e Bump frontend to 255cb23c (#3819) 2022-08-25 10:10:16 -04:00
Mike Degatano
32d65722e9 Handle multiple suggestions with different references (#3817) 2022-08-25 10:09:25 -04:00
Mike Degatano
d5f9fcfdc7 Fire events on issue changes (#3818)
* Fire events on issue changes

* API includes if suggestion has autofix
2022-08-25 11:42:31 +02:00
dependabot[bot]
ffa524d3a4 Bump actions/cache from 3.0.7 to 3.0.8 (#3816)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.7 to 3.0.8.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.7...v3.0.8)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-23 10:53:25 -04:00
Stefan Agner
9c7de4a6c3 Improve system behavior on low memory situation (#3781)
* Improve system behavior on low memory situation

Adjust OOM killer score to prevent crucial services from getting
selected.

* Adjust OOM score of DNS plug-in as well
2022-08-23 16:02:51 +02:00
Mike Degatano
b4e1e3e853 Identify and handle dhcp issues (#3806)
* Identify and handle dhcp issues

* Change test from DHCP to Connection Problem
2022-08-23 13:57:16 +02:00
Mike Degatano
c7f7fbd41a Remove static-only fields when method is auto (#3810) 2022-08-23 13:56:14 +02:00
Mike Degatano
cbddca2658 Rename dns checks to fit pattern (#3811)
* Rename dns checks to fit pattern

* Missed a patch reference
2022-08-23 13:54:22 +02:00
Mike Degatano
f4811a0243 Watchdog addon on successful but unexpected exit (#3815) 2022-08-22 20:29:27 -04:00
dependabot[bot]
024b813865 Bump awesomeversion from 22.6.0 to 22.8.0 (#3808)
Bumps [awesomeversion](https://github.com/ludeeus/awesomeversion) from 22.6.0 to 22.8.0.
- [Release notes](https://github.com/ludeeus/awesomeversion/releases)
- [Commits](https://github.com/ludeeus/awesomeversion/compare/22.6.0...22.8.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-19 16:31:41 -04:00
Stefan Agner
5919bc2252 Create asyncio loop explicitly (#3804)
Creating the asyncio loop explicitly. This fixes the following
deprecation warning on Python 3.10:
/usr/src/supervisor/supervisor/__main__.py:31: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
2022-08-19 10:01:01 -04:00
Stefan Agner
8bca34ec6b Update architecture compatibility JSON file (#3801)
* Update architecture compatibility JSON file

In particular, this enables 32-bit Arm add-ons for Yellow.

* Set correct hassio machine for odroid-xu4 (which is odroid-xu)
2022-08-19 10:11:01 +02:00
Mike Degatano
8b5e96a8ad Set autoreconnect to true for interfaces (#3807) 2022-08-19 10:09:44 +02:00
dependabot[bot]
2d908ffcec Bump docker from 5.0.3 to 6.0.0 (#3809)
Bumps [docker](https://github.com/docker/docker-py) from 5.0.3 to 6.0.0.
- [Release notes](https://github.com/docker/docker-py/releases)
- [Commits](https://github.com/docker/docker-py/compare/5.0.3...6.0.0)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-19 10:08:30 +02:00
Mike Degatano
c3f7a45d61 Fix memory calculation for cgroupv2 (#3802) 2022-08-17 16:50:08 -04:00
dependabot[bot]
97b05c2078 Bump time-machine from 2.8.0 to 2.8.1 (#3799)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-17 09:48:00 +02:00
dependabot[bot]
aa9a774939 Bump home-assistant/builder from 2022.06.2 to 2022.07.0 (#3713)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-17 09:30:03 +02:00
dependabot[bot]
3388a13693 Bump release-drafter/release-drafter from 5.20.0 to 5.20.1 (#3797)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-17 09:10:58 +02:00
dependabot[bot]
9957e3dd4c Bump coverage from 6.4.3 to 6.4.4 (#3798)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-17 09:03:45 +02:00
dependabot[bot]
01c2bd1b0c Bump sentry-sdk from 1.9.4 to 1.9.5 (#3800)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-17 08:58:41 +02:00
Mike Degatano
2cd7f9d1b0 Attempt plugin update before failing job condition (#3796) 2022-08-17 07:36:05 +02:00
Mike Degatano
5fc9484f73 Supervisor updated before addon repositories (#3795) 2022-08-17 07:28:06 +02:00
Pascal Vizeli
e6dfe83d62 Handle timedrift better if not synchronized (#3783)
* Handle timedrift better if not synchronized

* fix description

* adjust days

* Implement feedback

* Whoami error

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-08-16 16:04:17 -04:00
Franck Nijhof
3f88236495 Support for Docker manifests base images add-on build (#3724)
* Support for Docker manifests base images add-on build

* Set platform for build and tests

* Remove empty test

Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2022-08-16 14:34:32 +02:00
Mike Degatano
96065ed704 Bump to python 3.10 and alpine 3.16 (#3791)
* Bump to python 3.10

* 3.10 is not a number

* Musllinux wheels link

* Revert attrs 22.1.0 -> 21.2.0 for wheel

* Revert cryptography for wheel & pylint fix

* Precommit and devcontainer to 3.10

* pyupgrade rewriting things

* revert

* Update builder.yml

* fix rust

* Update builder.yml

Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2022-08-16 14:33:23 +02:00
dependabot[bot]
7754424cb8 Bump time-machine from 2.7.1 to 2.8.0 (#3793)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-16 11:37:48 +02:00
dependabot[bot]
be842d5e6c Bump debugpy from 1.6.2 to 1.6.3 (#3794)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-16 11:35:05 +02:00
Mike Degatano
c8f184f24c Add auto update option (#3769)
* Add update freeze option

* Freeze to auto update and plugin condition

* Add tests

* Add supervisor_version evaluation

* OS updates require supervisor up to date

* Run version check during startup
2022-08-15 12:13:22 -04:00
dependabot[bot]
e82cb5da45 Bump sentry-sdk from 1.9.3 to 1.9.4 (#3789)
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.9.3 to 1.9.4.
- [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.9.3...1.9.4)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-12 11:33:37 -04:00
dependabot[bot]
a968f6e90a Bump actions/cache from 3.0.6 to 3.0.7 (#3788)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.6 to 3.0.7.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v3.0.6...v3.0.7)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-12 11:33:00 -04:00
Mike Degatano
3eac3a6178 Absolute imports to relative imports (#3787) 2022-08-12 10:42:40 +02:00
dependabot[bot]
b831dce443 Bump sentry-sdk from 1.9.2 to 1.9.3 (#3782)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-10 11:40:41 +02:00
Mike Degatano
e62324e43f Set limits on watchdog retries (#3779)
* Set limits on watchdog retries

* Use relative import
2022-08-09 11:44:35 -04:00
Stefan Agner
a92058e6fc Mark CGroup V2 supported on Home Assistant OS (#3778)
* Mark CGroup V2 supported on Home Assistant OS

* Fix tests

* Fix comparision

* Move evaluation of CGroup after OSManager has been initialized
2022-08-09 11:32:51 +02:00
401 changed files with 8124 additions and 3355 deletions

View File

@@ -10,7 +10,7 @@
"visualstudioexptteam.vscodeintellicode",
"esbenp.prettier-vscode"
],
"mounts": [ "type=volume,target=/var/lib/docker" ],
"mounts": ["type=volume,target=/var/lib/docker"],
"settings": {
"terminal.integrated.profiles.linux": {
"zsh": {
@@ -26,7 +26,7 @@
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": ["--target-version", "py39"],
"python.formatting.blackArgs": ["--target-version", "py310"],
"python.formatting.blackPath": "/usr/local/bin/black",
"python.linting.banditPath": "/usr/local/bin/bandit",
"python.linting.flake8Path": "/usr/local/bin/flake8",

View File

@@ -33,10 +33,9 @@ on:
- setup.py
env:
DEFAULT_PYTHON: 3.9
DEFAULT_PYTHON: "3.10"
BUILD_NAME: supervisor
BUILD_TYPE: supervisor
WHEELS_TAG: 3.9-alpine3.14
jobs:
init:
@@ -89,17 +88,25 @@ jobs:
with:
fetch-depth: 0
- name: Write env-file
if: needs.init.outputs.requirements == 'true'
run: |
(
# Fix out of memory issues with rust
echo "CARGO_NET_GIT_FETCH_WITH_CLI=true"
) > .env_file
- name: Build wheels
if: needs.init.outputs.requirements == 'true'
uses: home-assistant/wheels@2022.01.2
uses: home-assistant/wheels@2022.06.7
with:
tag: ${{ env.WHEELS_TAG }}
abi: cp310
tag: musllinux_1_2
arch: ${{ matrix.arch }}
wheels-host: wheels.hass.io
wheels-key: ${{ secrets.WHEELS_KEY }}
wheels-user: wheels
apk: "build-base;libffi-dev;openssl-dev;cargo"
apk: "libffi-dev;openssl-dev"
skip-binary: aiohttp
env-file: true
requirements: "requirements.txt"
- name: Set version
@@ -128,7 +135,7 @@ jobs:
run: echo "BUILD_ARGS=--test" >> $GITHUB_ENV
- name: Build supervisor
uses: home-assistant/builder@2022.06.2
uses: home-assistant/builder@2022.09.0
with:
args: |
$BUILD_ARGS \
@@ -213,7 +220,7 @@ jobs:
- name: Build the Supervisor
if: needs.init.outputs.publish != 'true'
uses: home-assistant/builder@2022.06.2
uses: home-assistant/builder@2022.09.0
with:
args: |
--test \
@@ -290,6 +297,12 @@ jobs:
exit 1
fi
# Make sure its state is started
test="$(docker exec hassio_cli ha addons info core_ssh --no-progress --raw-json | jq -r '.data.state')"
if [ "$test" != "started" ]; then
exit 1
fi
- name: Check the Supervisor code sign
if: needs.init.outputs.publish == 'true'
run: |
@@ -362,6 +375,12 @@ jobs:
exit 1
fi
# Make sure its state is started
test="$(docker exec hassio_cli ha addons info core_ssh --no-progress --raw-json | jq -r '.data.state')"
if [ "$test" != "started" ]; then
exit 1
fi
- name: Restore SSL directory from backup
run: |
test=$(docker exec hassio_cli ha backups restore ${{ steps.backup.outputs.slug }} --folders ssl --no-progress --raw-json | jq -r '.result')

View File

@@ -8,7 +8,7 @@ on:
pull_request: ~
env:
DEFAULT_PYTHON: 3.9
DEFAULT_PYTHON: "3.10"
PRE_COMMIT_HOME: ~/.cache/pre-commit
DEFAULT_CAS: v1.0.2
@@ -17,21 +17,20 @@ jobs:
# This prevent upcoming jobs to do the same individually
prepare:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
name: Prepare Python ${{ matrix.python-version }} dependencies
outputs:
python-version: ${{ steps.python.outputs.python-version }}
name: Prepare Python dependencies
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
id: python
uses: actions/setup-python@v4.2.0
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: venv
key: |
@@ -45,7 +44,7 @@ jobs:
pip install -r requirements.txt -r requirements_tests.txt
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
@@ -65,18 +64,18 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v4.2.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
@@ -109,18 +108,18 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v4.2.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
@@ -128,7 +127,7 @@ jobs:
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
@@ -153,18 +152,18 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v4.2.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
@@ -185,18 +184,18 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v4.2.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
@@ -204,7 +203,7 @@ jobs:
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
@@ -226,18 +225,18 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v4.2.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
@@ -245,7 +244,7 @@ jobs:
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
@@ -270,18 +269,18 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v4.2.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
@@ -302,18 +301,18 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v4.2.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
@@ -321,7 +320,7 @@ jobs:
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: |
@@ -339,29 +338,26 @@ jobs:
pytest:
runs-on: ubuntu-latest
needs: prepare
strategy:
matrix:
python-version: [3.9]
name: Run tests Python ${{ matrix.python-version }}
name: Run tests Python ${{ needs.prepare.outputs.python-version }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v4.2.0
id: python
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Install CAS tools
uses: home-assistant/actions/helpers/cas@master
with:
version: ${{ env.DEFAULT_CAS }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
@@ -400,22 +396,22 @@ jobs:
coverage:
name: Process test coverage
runs-on: ubuntu-latest
needs: pytest
needs: ["pytest", "prepare"]
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/setup-python@v4.2.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
python-version: ${{ needs.prepare.outputs.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v3.0.6
uses: actions/cache@v3.0.10
with:
path: venv
key: |
${{ runner.os }}-venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
${{ runner.os }}-venv-${{ needs.prepare.outputs.python-version }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements_tests.txt') }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
@@ -430,4 +426,4 @@ jobs:
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.0
uses: codecov/codecov-action@v3.1.1

View File

@@ -36,7 +36,7 @@ jobs:
echo "::set-output name=version::$datepre.$newpost"
- name: Run Release Drafter
uses: release-drafter/release-drafter@v5.20.0
uses: release-drafter/release-drafter@v5.21.0
with:
tag: ${{ steps.version.outputs.version }}
name: ${{ steps.version.outputs.version }}

View File

@@ -9,10 +9,10 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v5.1.1
- uses: actions/stale@v6.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 60
days-before-stale: 30
days-before-close: 7
stale-issue-label: "stale"
exempt-issue-labels: "no-stale,Help%20wanted,help-wanted,pinned,rfc,security"

View File

@@ -7,7 +7,7 @@ repos:
- --safe
- --quiet
- --target-version
- py39
- py310
files: ^((supervisor|tests)/.+)?[^/]+\.py$
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
@@ -31,4 +31,4 @@ repos:
rev: v2.32.1
hooks:
- id: pyupgrade
args: [--py39-plus]
args: [--py310-plus]

View File

@@ -6,7 +6,6 @@ ENV \
SUPERVISOR_API=http://localhost
ARG \
BUILD_ARCH \
CAS_VERSION
# Install base
@@ -40,7 +39,7 @@ COPY requirements.txt .
RUN \
export MAKEFLAGS="-j$(nproc)" \
&& pip3 install --no-cache-dir --no-index --only-binary=:all: --find-links \
"https://wheels.home-assistant.io/alpine-$(cut -d '.' -f 1-2 < /etc/alpine-release)/${BUILD_ARCH}/" \
"https://wheels.home-assistant.io/musllinux/" \
-r ./requirements.txt \
&& rm -f requirements.txt

View File

@@ -1,11 +1,11 @@
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
aarch64: ghcr.io/home-assistant/aarch64-base-python:3.10-alpine3.16
armhf: ghcr.io/home-assistant/armhf-base-python:3.10-alpine3.16
armv7: ghcr.io/home-assistant/armv7-base-python:3.10-alpine3.16
amd64: ghcr.io/home-assistant/amd64-base-python:3.10-alpine3.16
i386: ghcr.io/home-assistant/i386-base-python:3.10-alpine3.16
codenotary:
signer: notary@home-assistant.io
base_image: notary@home-assistant.io

View File

@@ -1,25 +1,25 @@
aiodns==3.0.0
aiohttp==3.8.1
aiohttp==3.8.3
async_timeout==4.0.2
atomicwrites-homeassistant==1.4.1
attrs==22.1.0
awesomeversion==22.6.0
awesomeversion==22.9.0
brotli==1.0.9
cchardet==2.1.7
ciso8601==2.2.0
colorlog==6.6.0
colorlog==6.7.0
cpe==1.2.1
cryptography==37.0.4
debugpy==1.6.2
cryptography==38.0.1
debugpy==1.6.3
deepmerge==1.0.1
dirhash==0.2.1
docker==5.0.3
docker==6.0.0
gitpython==3.1.27
jinja2==3.1.2
pulsectl==22.3.2
pyudev==0.23.2
ruamel.yaml==0.17.17
pyudev==0.24.0
ruamel.yaml==0.17.21
securetar==2022.2.0
sentry-sdk==1.9.2
sentry-sdk==1.9.10
voluptuous==0.13.1
dbus-next==0.2.3
dbus-fast==1.24.0

View File

@@ -1,15 +1,15 @@
black==22.6.0
black==22.8.0
codecov==2.1.12
coverage==6.4.3
coverage==6.5.0
flake8-docstrings==1.6.0
flake8==5.0.4
pre-commit==2.20.0
pydocstyle==6.1.1
pylint==2.14.5
pylint==2.15.3
pytest-aiohttp==1.0.4
pytest-asyncio==0.18.3
pytest-cov==3.0.0
pytest-cov==4.0.0
pytest-timeout==2.1.0
pytest==7.1.2
pyupgrade==2.37.3
time-machine==2.7.1
pytest==7.1.3
pyupgrade==3.0.0
time-machine==2.8.2

View File

@@ -28,7 +28,8 @@ if __name__ == "__main__":
bootstrap.initialize_logging()
# Init async event loop
loop = asyncio.get_event_loop()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
# Check if all information are available to setup Supervisor
bootstrap.check_environment()

View File

@@ -3,7 +3,7 @@ import asyncio
from contextlib import suppress
import logging
import tarfile
from typing import Optional, Union
from typing import Union
from ..const import AddonBoot, AddonStartup, AddonState
from ..coresys import CoreSys, CoreSysAttributes
@@ -24,6 +24,7 @@ from ..resolution.const import ContextType, IssueType, SuggestionType
from ..store.addon import AddonStore
from ..utils import check_exception_chain
from .addon import Addon
from .const import ADDON_UPDATE_CONDITIONS
from .data import AddonsData
_LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -52,7 +53,7 @@ class AddonManager(CoreSysAttributes):
"""Return a list of all installed add-ons."""
return list(self.local.values())
def get(self, addon_slug: str, local_only: bool = False) -> Optional[AnyAddon]:
def get(self, addon_slug: str, local_only: bool = False) -> AnyAddon | None:
"""Return an add-on from slug.
Prio:
@@ -65,7 +66,7 @@ class AddonManager(CoreSysAttributes):
return self.store.get(addon_slug)
return None
def from_token(self, token: str) -> Optional[Addon]:
def from_token(self, token: str) -> Addon | None:
"""Return an add-on from Supervisor token."""
for addon in self.installed:
if token == addon.supervisor_token:
@@ -144,11 +145,7 @@ class AddonManager(CoreSysAttributes):
self.sys_capture_exception(err)
@Job(
conditions=[
JobCondition.FREE_SPACE,
JobCondition.INTERNET_HOST,
JobCondition.HEALTHY,
],
conditions=ADDON_UPDATE_CONDITIONS,
on_condition=AddonsJobError,
)
async def install(self, slug: str) -> None:
@@ -206,7 +203,7 @@ class AddonManager(CoreSysAttributes):
else:
addon.state = AddonState.UNKNOWN
await addon.remove_data()
await addon.unload()
# Cleanup audio settings
if addon.path_pulse.exists():
@@ -246,14 +243,10 @@ class AddonManager(CoreSysAttributes):
_LOGGER.info("Add-on '%s' successfully removed", slug)
@Job(
conditions=[
JobCondition.FREE_SPACE,
JobCondition.INTERNET_HOST,
JobCondition.HEALTHY,
],
conditions=ADDON_UPDATE_CONDITIONS,
on_condition=AddonsJobError,
)
async def update(self, slug: str, backup: Optional[bool] = False) -> None:
async def update(self, slug: str, backup: bool | None = False) -> None:
"""Update add-on."""
if slug not in self.local:
raise AddonsError(f"Add-on {slug} is not installed", _LOGGER.error)

View File

@@ -10,7 +10,7 @@ import secrets
import shutil
import tarfile
from tempfile import TemporaryDirectory
from typing import Any, Awaitable, Final, Optional
from typing import Any, Awaitable, Final
import aiohttp
from deepmerge import Merger
@@ -18,6 +18,7 @@ from securetar import atomic_contents_add, secure_path
import voluptuous as vol
from voluptuous.humanize import humanize_error
from ..bus import EventListener
from ..const import (
ATTR_ACCESS_TOKEN,
ATTR_AUDIO_INPUT,
@@ -58,6 +59,7 @@ from ..docker.stats import DockerStats
from ..exceptions import (
AddonConfigurationError,
AddonsError,
AddonsJobError,
AddonsNotSupportedError,
ConfigurationFileError,
DockerError,
@@ -65,10 +67,18 @@ from ..exceptions import (
)
from ..hardware.data import Device
from ..homeassistant.const import WSEvent, WSType
from ..jobs.const import JobExecutionLimit
from ..jobs.decorator import Job
from ..utils import check_port
from ..utils.apparmor import adjust_profile
from ..utils.json import read_json_file, write_json_file
from .const import WATCHDOG_RETRY_SECONDS, AddonBackupMode
from .const import (
WATCHDOG_MAX_ATTEMPTS,
WATCHDOG_RETRY_SECONDS,
WATCHDOG_THROTTLE_MAX_CALLS,
WATCHDOG_THROTTLE_PERIOD,
AddonBackupMode,
)
from .model import AddonModel, Data
from .options import AddonOptions
from .utils import remove_data
@@ -103,6 +113,58 @@ class Addon(AddonModel):
super().__init__(coresys, slug)
self.instance: DockerAddon = DockerAddon(coresys, self)
self._state: AddonState = AddonState.UNKNOWN
self._manual_stop: bool = (
self.sys_hardware.helper.last_boot != self.sys_config.last_boot
)
self._listeners: list[EventListener] = []
@Job(
name=f"addon_{slug}_restart_after_problem",
limit=JobExecutionLimit.THROTTLE_RATE_LIMIT,
throttle_period=WATCHDOG_THROTTLE_PERIOD,
throttle_max_calls=WATCHDOG_THROTTLE_MAX_CALLS,
on_condition=AddonsJobError,
)
async def restart_after_problem(addon: Addon, state: ContainerState):
"""Restart unhealthy or failed addon."""
attempts = 0
while await addon.instance.current_state() == state:
if not addon.in_progress:
_LOGGER.warning(
"Watchdog found addon %s is %s, restarting...",
addon.name,
state.value,
)
try:
if state == ContainerState.FAILED:
# Ensure failed container is removed before attempting reanimation
if attempts == 0:
with suppress(DockerError):
await addon.instance.stop(remove_container=True)
await addon.start()
else:
await addon.restart()
except AddonsError as err:
attempts = attempts + 1
_LOGGER.error(
"Watchdog restart of addon %s failed!", addon.name
)
addon.sys_capture_exception(err)
else:
break
if attempts >= WATCHDOG_MAX_ATTEMPTS:
_LOGGER.critical(
"Watchdog cannot restart addon %s, failed all %s attempts",
addon.name,
attempts,
)
break
await asyncio.sleep(WATCHDOG_RETRY_SECONDS)
self._restart_after_problem = restart_after_problem
def __repr__(self) -> str:
"""Return internal representation."""
@@ -137,11 +199,15 @@ class Addon(AddonModel):
async def load(self) -> None:
"""Async initialize of object."""
self.sys_bus.register_event(
BusEvent.DOCKER_CONTAINER_STATE_CHANGE, self.container_state_changed
self._listeners.append(
self.sys_bus.register_event(
BusEvent.DOCKER_CONTAINER_STATE_CHANGE, self.container_state_changed
)
)
self.sys_bus.register_event(
BusEvent.DOCKER_CONTAINER_STATE_CHANGE, self.watchdog_container
self._listeners.append(
self.sys_bus.register_event(
BusEvent.DOCKER_CONTAINER_STATE_CHANGE, self.watchdog_container
)
)
with suppress(DockerError):
@@ -183,7 +249,7 @@ class Addon(AddonModel):
return self._available(self.data_store)
@property
def version(self) -> Optional[str]:
def version(self) -> str | None:
"""Return installed version."""
return self.persist[ATTR_VERSION]
@@ -207,7 +273,7 @@ class Addon(AddonModel):
)
@options.setter
def options(self, value: Optional[dict[str, Any]]) -> None:
def options(self, value: dict[str, Any] | None) -> None:
"""Store user add-on options."""
self.persist[ATTR_OPTIONS] = {} if value is None else deepcopy(value)
@@ -252,17 +318,17 @@ class Addon(AddonModel):
return self.persist[ATTR_UUID]
@property
def supervisor_token(self) -> Optional[str]:
def supervisor_token(self) -> str | None:
"""Return access token for Supervisor API."""
return self.persist.get(ATTR_ACCESS_TOKEN)
@property
def ingress_token(self) -> Optional[str]:
def ingress_token(self) -> str | None:
"""Return access token for Supervisor API."""
return self.persist.get(ATTR_INGRESS_TOKEN)
@property
def ingress_entry(self) -> Optional[str]:
def ingress_entry(self) -> str | None:
"""Return ingress external URL."""
if self.with_ingress:
return f"/api/hassio_ingress/{self.ingress_token}"
@@ -284,12 +350,12 @@ class Addon(AddonModel):
self.persist[ATTR_PROTECTED] = value
@property
def ports(self) -> Optional[dict[str, Optional[int]]]:
def ports(self) -> dict[str, int | None] | None:
"""Return ports of add-on."""
return self.persist.get(ATTR_NETWORK, super().ports)
@ports.setter
def ports(self, value: Optional[dict[str, Optional[int]]]) -> None:
def ports(self, value: dict[str, int | None] | None) -> None:
"""Set custom ports of add-on."""
if value is None:
self.persist.pop(ATTR_NETWORK, None)
@@ -304,7 +370,7 @@ class Addon(AddonModel):
self.persist[ATTR_NETWORK] = new_ports
@property
def ingress_url(self) -> Optional[str]:
def ingress_url(self) -> str | None:
"""Return URL to ingress url."""
if not self.with_ingress:
return None
@@ -315,7 +381,7 @@ class Addon(AddonModel):
return url
@property
def webui(self) -> Optional[str]:
def webui(self) -> str | None:
"""Return URL to webui or None."""
url = super().webui
if not url:
@@ -343,7 +409,7 @@ class Addon(AddonModel):
return f"{proto}://[HOST]:{port}{s_suffix}"
@property
def ingress_port(self) -> Optional[int]:
def ingress_port(self) -> int | None:
"""Return Ingress port."""
if not self.with_ingress:
return None
@@ -354,7 +420,7 @@ class Addon(AddonModel):
return port
@property
def ingress_panel(self) -> Optional[bool]:
def ingress_panel(self) -> bool | None:
"""Return True if the add-on access support ingress."""
if not self.with_ingress:
return None
@@ -367,19 +433,19 @@ class Addon(AddonModel):
self.persist[ATTR_INGRESS_PANEL] = value
@property
def audio_output(self) -> Optional[str]:
def audio_output(self) -> str | None:
"""Return a pulse profile for output or None."""
if not self.with_audio:
return None
return self.persist.get(ATTR_AUDIO_OUTPUT)
@audio_output.setter
def audio_output(self, value: Optional[str]):
def audio_output(self, value: str | None):
"""Set audio output profile settings."""
self.persist[ATTR_AUDIO_OUTPUT] = value
@property
def audio_input(self) -> Optional[str]:
def audio_input(self) -> str | None:
"""Return pulse profile for input or None."""
if not self.with_audio:
return None
@@ -387,12 +453,12 @@ class Addon(AddonModel):
return self.persist.get(ATTR_AUDIO_INPUT)
@audio_input.setter
def audio_input(self, value: Optional[str]) -> None:
def audio_input(self, value: str | None) -> None:
"""Set audio input settings."""
self.persist[ATTR_AUDIO_INPUT] = value
@property
def image(self) -> Optional[str]:
def image(self) -> str | None:
"""Return image name of add-on."""
return self.persist.get(ATTR_IMAGE)
@@ -444,6 +510,11 @@ class Addon(AddonModel):
return options_schema.pwned
@property
def loaded(self) -> bool:
"""Is add-on loaded."""
return bool(self._listeners)
def save_persist(self) -> None:
"""Save data of add-on."""
self.sys_addons.data.save_data()
@@ -512,8 +583,11 @@ class Addon(AddonModel):
raise AddonConfigurationError()
async def remove_data(self) -> None:
"""Remove add-on data."""
async def unload(self) -> None:
"""Unload add-on and remove data."""
for listener in self._listeners:
self.sys_bus.remove_listener(listener)
if not self.path_data.is_dir():
return
@@ -625,6 +699,7 @@ class Addon(AddonModel):
async def stop(self) -> None:
"""Stop add-on."""
self._manual_stop = True
try:
await self.instance.stop()
except DockerError as err:
@@ -870,6 +945,10 @@ class Addon(AddonModel):
)
raise AddonsError() from err
# Is add-on loaded
if not self.loaded:
await self.load()
# Run add-on
if data[ATTR_STATE] == AddonState.STARTED:
return await self.start()
@@ -893,6 +972,7 @@ class Addon(AddonModel):
ContainerState.HEALTHY,
ContainerState.UNHEALTHY,
]:
self._manual_stop = False
self.state = AddonState.STARTED
elif event.state == ContainerState.STOPPED:
self.state = AddonState.STOPPED
@@ -901,43 +981,16 @@ class Addon(AddonModel):
async def watchdog_container(self, event: DockerContainerStateEvent) -> None:
"""Process state changes in addon container and restart if necessary."""
if not (event.name == self.instance.name and self.watchdog):
if event.name != self.instance.name:
return
if event.state == ContainerState.UNHEALTHY:
while await self.instance.current_state() == event.state:
if not self.in_progress:
_LOGGER.warning(
"Watchdog found addon %s is unhealthy, restarting...", self.name
)
try:
await self.restart()
except AddonsError as err:
_LOGGER.error("Watchdog restart of addon %s failed!", self.name)
self.sys_capture_exception(err)
else:
break
# Skip watchdog if not enabled or manual stopped
if not self.watchdog or self._manual_stop:
return
await asyncio.sleep(WATCHDOG_RETRY_SECONDS)
elif event.state == ContainerState.FAILED:
# Ensure failed container is removed before attempting reanimation
with suppress(DockerError):
await self.instance.stop(remove_container=True)
while await self.instance.current_state() == event.state:
if not self.in_progress:
_LOGGER.warning(
"Watchdog found addon %s failed, restarting...", self.name
)
try:
await self.start()
except AddonsError as err:
_LOGGER.error(
"Watchdog reanimation of addon %s failed!", self.name
)
self.sys_capture_exception(err)
else:
break
await asyncio.sleep(WATCHDOG_RETRY_SECONDS)
if event.state in [
ContainerState.FAILED,
ContainerState.STOPPED,
ContainerState.UNHEALTHY,
]:
await self._restart_after_problem(self, event.state)

View File

@@ -15,6 +15,7 @@ from ..const import (
META_ADDON,
)
from ..coresys import CoreSys, CoreSysAttributes
from ..docker.interface import MAP_ARCH
from ..exceptions import ConfigurationFileError
from ..utils.common import FileConfiguration, find_one_filetype
from .validate import SCHEMA_BUILD_CONFIG
@@ -50,6 +51,9 @@ class AddonBuild(FileConfiguration, CoreSysAttributes):
if not self._data[ATTR_BUILD_FROM]:
return f"ghcr.io/home-assistant/{self.sys_arch.default}-base:latest"
if isinstance(self._data[ATTR_BUILD_FROM], str):
return self._data[ATTR_BUILD_FROM]
# Evaluate correct base image
arch = self.sys_arch.match(list(self._data[ATTR_BUILD_FROM].keys()))
return self._data[ATTR_BUILD_FROM][arch]
@@ -87,6 +91,7 @@ class AddonBuild(FileConfiguration, CoreSysAttributes):
"pull": True,
"forcerm": not self.sys_dev,
"squash": self.squash,
"platform": MAP_ARCH[self.sys_arch.match(self.addon.arch)],
"labels": {
"io.hass.version": version,
"io.hass.arch": self.sys_arch.default,

View File

@@ -1,6 +1,9 @@
"""Add-on static data."""
from datetime import timedelta
from enum import Enum
from ..jobs.const import JobCondition
class AddonBackupMode(str, Enum):
"""Backup mode of an Add-on."""
@@ -12,3 +15,14 @@ class AddonBackupMode(str, Enum):
ATTR_BACKUP = "backup"
ATTR_CODENOTARY = "codenotary"
WATCHDOG_RETRY_SECONDS = 10
WATCHDOG_MAX_ATTEMPTS = 5
WATCHDOG_THROTTLE_PERIOD = timedelta(minutes=30)
WATCHDOG_THROTTLE_MAX_CALLS = 10
ADDON_UPDATE_CONDITIONS = [
JobCondition.FREE_SPACE,
JobCondition.HEALTHY,
JobCondition.INTERNET_HOST,
JobCondition.PLUGINS_UPDATED,
JobCondition.SUPERVISOR_UPDATED,
]

View File

@@ -1,12 +1,10 @@
"""Init file for Supervisor add-ons."""
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Awaitable, Optional
from typing import Any, Awaitable
from awesomeversion import AwesomeVersion, AwesomeVersionException
from supervisor.addons.const import AddonBackupMode
from ..const import (
ATTR_ADVANCED,
ATTR_APPARMOR,
@@ -79,7 +77,7 @@ from ..const import (
)
from ..coresys import CoreSys, CoreSysAttributes
from ..docker.const import Capabilities
from .const import ATTR_BACKUP, ATTR_CODENOTARY
from .const import ATTR_BACKUP, ATTR_CODENOTARY, AddonBackupMode
from .options import AddonOptions, UiOptions
from .validate import RE_SERVICE, RE_VOLUME
@@ -125,7 +123,7 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_BOOT]
@property
def auto_update(self) -> Optional[bool]:
def auto_update(self) -> bool | None:
"""Return if auto update is enable."""
return None
@@ -150,22 +148,22 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_TIMEOUT]
@property
def uuid(self) -> Optional[str]:
def uuid(self) -> str | None:
"""Return an API token for this add-on."""
return None
@property
def supervisor_token(self) -> Optional[str]:
def supervisor_token(self) -> str | None:
"""Return access token for Supervisor API."""
return None
@property
def ingress_token(self) -> Optional[str]:
def ingress_token(self) -> str | None:
"""Return access token for Supervisor API."""
return None
@property
def ingress_entry(self) -> Optional[str]:
def ingress_entry(self) -> str | None:
"""Return ingress external URL."""
return None
@@ -175,7 +173,7 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_DESCRIPTON]
@property
def long_description(self) -> Optional[str]:
def long_description(self) -> str | None:
"""Return README.md as long_description."""
readme = Path(self.path_location, "README.md")
@@ -245,32 +243,32 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data.get(ATTR_DISCOVERY, [])
@property
def ports_description(self) -> Optional[dict[str, str]]:
def ports_description(self) -> dict[str, str] | None:
"""Return descriptions of ports."""
return self.data.get(ATTR_PORTS_DESCRIPTION)
@property
def ports(self) -> Optional[dict[str, Optional[int]]]:
def ports(self) -> dict[str, int | None] | None:
"""Return ports of add-on."""
return self.data.get(ATTR_PORTS)
@property
def ingress_url(self) -> Optional[str]:
def ingress_url(self) -> str | None:
"""Return URL to ingress url."""
return None
@property
def webui(self) -> Optional[str]:
def webui(self) -> str | None:
"""Return URL to webui or None."""
return self.data.get(ATTR_WEBUI)
@property
def watchdog(self) -> Optional[str]:
def watchdog(self) -> str | None:
"""Return URL to for watchdog or None."""
return self.data.get(ATTR_WATCHDOG)
@property
def ingress_port(self) -> Optional[int]:
def ingress_port(self) -> int | None:
"""Return Ingress port."""
return None
@@ -315,7 +313,7 @@ class AddonModel(CoreSysAttributes, ABC):
return [Path(node) for node in self.data.get(ATTR_DEVICES, [])]
@property
def environment(self) -> Optional[dict[str, str]]:
def environment(self) -> dict[str, str] | None:
"""Return environment of add-on."""
return self.data.get(ATTR_ENVIRONMENT)
@@ -364,12 +362,12 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data.get(ATTR_BACKUP_EXCLUDE, [])
@property
def backup_pre(self) -> Optional[str]:
def backup_pre(self) -> str | None:
"""Return pre-backup command."""
return self.data.get(ATTR_BACKUP_PRE)
@property
def backup_post(self) -> Optional[str]:
def backup_post(self) -> str | None:
"""Return post-backup command."""
return self.data.get(ATTR_BACKUP_POST)
@@ -394,7 +392,7 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_INGRESS]
@property
def ingress_panel(self) -> Optional[bool]:
def ingress_panel(self) -> bool | None:
"""Return True if the add-on access support ingress."""
return None
@@ -444,7 +442,7 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_DEVICETREE]
@property
def with_tmpfs(self) -> Optional[str]:
def with_tmpfs(self) -> str | None:
"""Return if tmp is in memory of add-on."""
return self.data[ATTR_TMPFS]
@@ -464,12 +462,12 @@ class AddonModel(CoreSysAttributes, ABC):
return self.data[ATTR_VIDEO]
@property
def homeassistant_version(self) -> Optional[str]:
def homeassistant_version(self) -> str | None:
"""Return min Home Assistant version they needed by Add-on."""
return self.data.get(ATTR_HOMEASSISTANT)
@property
def url(self) -> Optional[str]:
def url(self) -> str | None:
"""Return URL of add-on."""
return self.data.get(ATTR_URL)
@@ -512,7 +510,7 @@ class AddonModel(CoreSysAttributes, ABC):
return self.sys_arch.default
@property
def image(self) -> Optional[str]:
def image(self) -> str | None:
"""Generate image name from data."""
return self._image(self.data)
@@ -573,7 +571,7 @@ class AddonModel(CoreSysAttributes, ABC):
return AddonOptions(self.coresys, raw_schema, self.name, self.slug)
@property
def schema_ui(self) -> Optional[list[dict[any, any]]]:
def schema_ui(self) -> list[dict[any, any]] | None:
"""Create a UI schema for add-on options."""
raw_schema = self.data[ATTR_SCHEMA]
@@ -592,7 +590,7 @@ class AddonModel(CoreSysAttributes, ABC):
return ATTR_CODENOTARY in self.data
@property
def codenotary(self) -> Optional[str]:
def codenotary(self) -> str | None:
"""Return Signer email address for CAS."""
return self.data.get(ATTR_CODENOTARY)
@@ -616,7 +614,7 @@ class AddonModel(CoreSysAttributes, ABC):
return False
# Home Assistant
version: Optional[AwesomeVersion] = config.get(ATTR_HOMEASSISTANT)
version: AwesomeVersion | None = config.get(ATTR_HOMEASSISTANT)
try:
return self.sys_homeassistant.version >= version
except (AwesomeVersionException, TypeError):
@@ -640,7 +638,7 @@ class AddonModel(CoreSysAttributes, ABC):
"""Uninstall this add-on."""
return self.sys_addons.uninstall(self.slug)
def update(self, backup: Optional[bool] = False) -> Awaitable[None]:
def update(self, backup: bool | None = False) -> Awaitable[None]:
"""Update this add-on."""
return self.sys_addons.update(self.slug, backup=backup)

View File

@@ -3,7 +3,7 @@ import hashlib
import logging
from pathlib import Path
import re
from typing import Any, Union
from typing import Any
import voluptuous as vol
@@ -293,7 +293,7 @@ class UiOptions(CoreSysAttributes):
multiple: bool = False,
) -> None:
"""Validate a single element."""
ui_node: dict[str, Union[str, bool, float, list[str]]] = {"name": key}
ui_node: dict[str, str | bool | float | list[str]] = {"name": key}
# If multiple
if multiple:

View File

@@ -7,8 +7,6 @@ import uuid
import voluptuous as vol
from supervisor.addons.const import AddonBackupMode
from ..const import (
ARCH_ALL,
ATTR_ACCESS_TOKEN,
@@ -110,7 +108,7 @@ from ..validate import (
uuid_match,
version_tag,
)
from .const import ATTR_BACKUP, ATTR_CODENOTARY
from .const import ATTR_BACKUP, ATTR_CODENOTARY, AddonBackupMode
from .options import RE_SCHEMA_ELEMENT
_LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -353,8 +351,9 @@ SCHEMA_ADDON_CONFIG = vol.All(
# pylint: disable=no-value-for-parameter
SCHEMA_BUILD_CONFIG = vol.Schema(
{
vol.Optional(ATTR_BUILD_FROM, default=dict): vol.Schema(
{vol.In(ARCH_ALL): vol.Match(RE_DOCKER_IMAGE_BUILD)}
vol.Optional(ATTR_BUILD_FROM, default=dict): vol.Any(
vol.Match(RE_DOCKER_IMAGE_BUILD),
vol.Schema({vol.In(ARCH_ALL): vol.Match(RE_DOCKER_IMAGE_BUILD)}),
),
vol.Optional(ATTR_SQUASH, default=False): vol.Boolean(),
vol.Optional(ATTR_ARGS, default=dict): vol.Schema({str: str}),

View File

@@ -1,15 +1,13 @@
"""Init file for Supervisor RESTful API."""
import logging
from pathlib import Path
from typing import Any, Optional
from typing import Any
from aiohttp import web
from supervisor.api.utils import api_process
from supervisor.const import AddonState
from supervisor.exceptions import APIAddonNotInstalled
from ..const import AddonState
from ..coresys import CoreSys, CoreSysAttributes
from ..exceptions import APIAddonNotInstalled
from .addons import APIAddons
from .audio import APIAudio
from .auth import APIAuth
@@ -35,6 +33,7 @@ from .security import APISecurity
from .services import APIServices
from .store import APIStore
from .supervisor import APISupervisor
from .utils import api_process
_LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -64,7 +63,7 @@ class RestAPI(CoreSysAttributes):
# service stuff
self._runner: web.AppRunner = web.AppRunner(self.webapp)
self._site: Optional[web.TCPSite] = None
self._site: web.TCPSite | None = None
async def load(self) -> None:
"""Register REST API Calls."""
@@ -278,6 +277,10 @@ class RestAPI(CoreSysAttributes):
"/resolution/issue/{issue}",
api_resolution.dismiss_issue,
),
web.get(
"/resolution/issue/{issue}/suggestions",
api_resolution.suggestions_for_issue,
),
web.post("/resolution/healthcheck", api_resolution.healthcheck),
]
)
@@ -445,11 +448,13 @@ class RestAPI(CoreSysAttributes):
self.webapp.add_routes(
[
web.get("/backups", api_backups.list),
web.get("/backups/info", api_backups.info),
web.post("/backups/options", api_backups.options),
web.post("/backups/reload", api_backups.reload),
web.post("/backups/new/full", api_backups.backup_full),
web.post("/backups/new/partial", api_backups.backup_partial),
web.post("/backups/new/upload", api_backups.upload),
web.get("/backups/{slug}/info", api_backups.info),
web.get("/backups/{slug}/info", api_backups.backup_info),
web.delete("/backups/{slug}", api_backups.remove),
web.post("/backups/{slug}/restore/full", api_backups.restore_full),
web.post(

View File

@@ -9,13 +9,14 @@ from aiohttp import web
from aiohttp.hdrs import CONTENT_DISPOSITION
import voluptuous as vol
from ..backups.validate import ALL_FOLDERS, FOLDER_HOMEASSISTANT
from ..backups.validate import ALL_FOLDERS, FOLDER_HOMEASSISTANT, days_until_stale
from ..const import (
ATTR_ADDONS,
ATTR_BACKUPS,
ATTR_COMPRESSED,
ATTR_CONTENT,
ATTR_DATE,
ATTR_DAYS_UNTIL_STALE,
ATTR_FOLDERS,
ATTR_HOMEASSISTANT,
ATTR_NAME,
@@ -24,6 +25,7 @@ from ..const import (
ATTR_REPOSITORIES,
ATTR_SIZE,
ATTR_SLUG,
ATTR_SUPERVISOR_VERSION,
ATTR_TYPE,
ATTR_VERSION,
)
@@ -68,6 +70,12 @@ SCHEMA_BACKUP_PARTIAL = SCHEMA_BACKUP_FULL.extend(
}
)
SCHEMA_OPTIONS = vol.Schema(
{
vol.Optional(ATTR_DAYS_UNTIL_STALE): days_until_stale,
}
)
class APIBackups(CoreSysAttributes):
"""Handle RESTful API for backups functions."""
@@ -79,27 +87,30 @@ class APIBackups(CoreSysAttributes):
raise APIError("Backup does not exist")
return backup
def _list_backups(self):
"""Return list of backups."""
return [
{
ATTR_SLUG: backup.slug,
ATTR_NAME: backup.name,
ATTR_DATE: backup.date,
ATTR_TYPE: backup.sys_type,
ATTR_SIZE: backup.size,
ATTR_PROTECTED: backup.protected,
ATTR_COMPRESSED: backup.compressed,
ATTR_CONTENT: {
ATTR_HOMEASSISTANT: backup.homeassistant_version is not None,
ATTR_ADDONS: backup.addon_list,
ATTR_FOLDERS: backup.folders,
},
}
for backup in self.sys_backups.list_backups
]
@api_process
async def list(self, request):
"""Return backup list."""
data_backups = []
for backup in self.sys_backups.list_backups:
data_backups.append(
{
ATTR_SLUG: backup.slug,
ATTR_NAME: backup.name,
ATTR_DATE: backup.date,
ATTR_TYPE: backup.sys_type,
ATTR_SIZE: backup.size,
ATTR_PROTECTED: backup.protected,
ATTR_COMPRESSED: backup.compressed,
ATTR_CONTENT: {
ATTR_HOMEASSISTANT: backup.homeassistant_version is not None,
ATTR_ADDONS: backup.addon_list,
ATTR_FOLDERS: backup.folders,
},
}
)
data_backups = self._list_backups()
if request.path == "/snapshots":
# Kept for backwards compability
@@ -107,6 +118,24 @@ class APIBackups(CoreSysAttributes):
return {ATTR_BACKUPS: data_backups}
@api_process
async def info(self, request):
"""Return backup list and manager info."""
return {
ATTR_BACKUPS: self._list_backups(),
ATTR_DAYS_UNTIL_STALE: self.sys_backups.days_until_stale,
}
@api_process
async def options(self, request):
"""Set backup manager options."""
body = await api_validate(SCHEMA_OPTIONS, request)
if ATTR_DAYS_UNTIL_STALE in body:
self.sys_backups.days_until_stale = body[ATTR_DAYS_UNTIL_STALE]
self.sys_backups.save_data()
@api_process
async def reload(self, request):
"""Reload backup list."""
@@ -114,7 +143,7 @@ class APIBackups(CoreSysAttributes):
return True
@api_process
async def info(self, request):
async def backup_info(self, request):
"""Return backup info."""
backup = self._extract_slug(request)
@@ -137,6 +166,7 @@ class APIBackups(CoreSysAttributes):
ATTR_SIZE: backup.size,
ATTR_COMPRESSED: backup.compressed,
ATTR_PROTECTED: backup.protected,
ATTR_SUPERVISOR_VERSION: backup.supervisor_version,
ATTR_HOMEASSISTANT: backup.homeassistant_version,
ATTR_ADDONS: data_addons,
ATTR_REPOSITORIES: backup.repositories,

View File

@@ -120,25 +120,25 @@ class APIHost(CoreSysAttributes):
def service_start(self, request):
"""Start a service."""
unit = request.match_info.get(SERVICE)
return asyncio.shield(self.sys_host.services.start(unit))
return [asyncio.shield(self.sys_host.services.start(unit))]
@api_process
def service_stop(self, request):
"""Stop a service."""
unit = request.match_info.get(SERVICE)
return asyncio.shield(self.sys_host.services.stop(unit))
return [asyncio.shield(self.sys_host.services.stop(unit))]
@api_process
def service_reload(self, request):
"""Reload a service."""
unit = request.match_info.get(SERVICE)
return asyncio.shield(self.sys_host.services.reload(unit))
return [asyncio.shield(self.sys_host.services.reload(unit))]
@api_process
def service_restart(self, request):
"""Restart a service."""
unit = request.match_info.get(SERVICE)
return asyncio.shield(self.sys_host.services.restart(unit))
return [asyncio.shield(self.sys_host.services.restart(unit))]
@api_process_raw(CONTENT_TYPE_BINARY)
def logs(self, request: web.Request) -> Awaitable[bytes]:

View File

@@ -2,7 +2,7 @@
import asyncio
from ipaddress import ip_address
import logging
from typing import Any, Union
from typing import Any
import aiohttp
from aiohttp import ClientTimeout, hdrs, web
@@ -86,7 +86,7 @@ class APIIngress(CoreSysAttributes):
@require_home_assistant
async def handler(
self, request: web.Request
) -> Union[web.Response, web.StreamResponse, web.WebSocketResponse]:
) -> web.Response | web.StreamResponse | web.WebSocketResponse:
"""Route data to Supervisor ingress service."""
# Check Ingress Session
@@ -157,7 +157,7 @@ class APIIngress(CoreSysAttributes):
async def _handle_request(
self, request: web.Request, addon: Addon, path: str
) -> Union[web.Response, web.StreamResponse]:
) -> web.Response | web.StreamResponse:
"""Ingress route for request."""
url = self._create_url(addon, path)
source_header = _init_header(request, addon)
@@ -216,9 +216,7 @@ class APIIngress(CoreSysAttributes):
return response
def _init_header(
request: web.Request, addon: str
) -> Union[CIMultiDict, dict[str, str]]:
def _init_header(request: web.Request, addon: str) -> CIMultiDict | dict[str, str]:
"""Create initial header."""
headers = {}

View File

@@ -30,6 +30,7 @@ from ..const import (
ATTR_PARENT,
ATTR_PRIMARY,
ATTR_PSK,
ATTR_READY,
ATTR_SIGNAL,
ATTR_SSID,
ATTR_SUPERVISOR_INTERNET,
@@ -89,6 +90,7 @@ def ipconfig_struct(config: IpConfig) -> dict[str, Any]:
ATTR_ADDRESS: [address.with_prefixlen for address in config.address],
ATTR_NAMESERVERS: [str(address) for address in config.nameservers],
ATTR_GATEWAY: str(config.gateway) if config.gateway else None,
ATTR_READY: config.ready,
}
@@ -194,12 +196,14 @@ class APINetwork(CoreSysAttributes):
for key, config in body.items():
if key == ATTR_IPV4:
interface.ipv4 = attr.evolve(
interface.ipv4 or IpConfig(InterfaceMethod.STATIC, [], None, []),
interface.ipv4
or IpConfig(InterfaceMethod.STATIC, [], None, [], None),
**config,
)
elif key == ATTR_IPV6:
interface.ipv6 = attr.evolve(
interface.ipv6 or IpConfig(InterfaceMethod.STATIC, [], None, []),
interface.ipv6
or IpConfig(InterfaceMethod.STATIC, [], None, [], None),
**config,
)
elif key == ATTR_WIFI:
@@ -218,7 +222,9 @@ class APINetwork(CoreSysAttributes):
@api_process
def reload(self, request: web.Request) -> Awaitable[None]:
"""Reload network data."""
return asyncio.shield(self.sys_host.network.update())
return asyncio.shield(
self.sys_host.network.update(force_connectivity_check=True)
)
@api_process
async def scan_accesspoints(self, request: web.Request) -> dict[str, Any]:
@@ -255,6 +261,7 @@ class APINetwork(CoreSysAttributes):
body[ATTR_IPV4].get(ATTR_ADDRESS, []),
body[ATTR_IPV4].get(ATTR_GATEWAY, None),
body[ATTR_IPV4].get(ATTR_NAMESERVERS, []),
None,
)
ipv6_config = None
@@ -264,6 +271,7 @@ class APINetwork(CoreSysAttributes):
body[ATTR_IPV6].get(ATTR_ADDRESS, []),
body[ATTR_IPV6].get(ATTR_GATEWAY, None),
body[ATTR_IPV6].get(ATTR_NAMESERVERS, []),
None,
)
vlan_interface = Interface(

View File

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

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

File diff suppressed because one or more lines are too long

Binary file not shown.

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

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,3 @@
{
"entrypoint.js": "/api/hassio/app/frontend_es5/entrypoint.75b60951.js"
"entrypoint.js": "/api/hassio/app/frontend_es5/entrypoint.169d7fb4.js"
}

View File

@@ -912,4 +912,4 @@
}
}
`]}},{kind:"method",key:"firstUpdated",value:async function(){if(""===this.route.path){const e=(0,d.io)("addon"),t=(0,d.io)("repository_url");if(t){if(!(await(0,h.Er)(this.hass)).repositories.find((e=>e.source===t))){if(!await(0,p.g7)(this,{title:this.supervisor.localize("my.add_addon_repository_title"),text:this.supervisor.localize("my.add_addon_repository_description",{addon:e,repository:t}),confirmText:this.supervisor.localize("common.add"),dismissText:this.supervisor.localize("common.cancel")}))return void(this._error=this.supervisor.localize("my.error_repository_not_found"));try{await(0,h.FV)(this.hass,t)}catch(e){this._error=(0,c.js)(e)}}}if(e){const t=(await(0,h.Er)(this.hass)).addons.some((t=>t.slug===e));t?(0,a.c)(`/hassio/addon/${e}`,{replace:!0}):this._error=this.supervisor.localize("my.error_addon_not_found")}}this.addEventListener("hass-api-called",(e=>this._apiCalled(e)))}},{kind:"method",key:"_apiCalled",value:async function(e){var t;if(!e.detail.success)return;const r=null===(t=e.detail.path)||void 0===t?void 0:t.split("/");if(!r||0===r.length)return;const i=r[r.length-1];["uninstall","install","update","start","stop"].includes(i)&&(0,s.B)(this,"supervisor-collection-refresh",{collection:"addon"}),"uninstall"===i?window.history.back():"install"===i?this.addon=await(0,l.AD)(this.hass,this.addon.slug):await this._routeDataChanged()}},{kind:"method",key:"updated",value:function(e){e.has("route")&&!this.addon&&this._routeDataChanged()}},{kind:"method",key:"_routeDataChanged",value:async function(){const e=this.route.path.split("/")[1];if(e)try{if(!this.supervisor.addon){const e=await(0,l.yt)(this.hass);(0,s.B)(this,"supervisor-update",{addon:e})}this.addon=await(0,l.R_)(this.hass,this.supervisor,e)}catch(e){this._error=`Error fetching addon info: ${(0,c.js)(e)}`,this.addon=void 0}}}]}}),i.oi)}}]);
//# sourceMappingURL=29a9c475.js.map
//# sourceMappingURL=139ce644.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -98,4 +98,4 @@
margin-top: 12px;
}
`]}}]}}),i.oi)},7628:(e,r,t)=>{t.r(r),t.d(r,{dump:()=>i.$w});var i=t(7426)}}]);
//# sourceMappingURL=faa8eea5.js.map
//# sourceMappingURL=50e67b8b.js.map

Binary file not shown.

File diff suppressed because one or more lines are too long

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

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.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,3 @@
{
"entrypoint.js": "/api/hassio/app/frontend_latest/entrypoint.f358ba39.js"
"entrypoint.js": "/api/hassio/app/frontend_latest/entrypoint.24687610.js"
}

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