Compare commits

...

16 Commits

Author SHA1 Message Date
Pascal Vizeli
a5cc3cba63 Docker info more robust (#3720) 2022-07-07 10:01:57 +02:00
dependabot[bot]
9266062709 Bump cryptography from 36.0.2 to 37.0.4 (#3714)
Bumps [cryptography](https://github.com/pyca/cryptography) from 36.0.2 to 37.0.4.
- [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/36.0.2...37.0.4)

---
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>
2022-07-06 12:12:07 -04:00
Franck Nijhof
bacedd1622 Bump black in pre-commit (#3709) 2022-07-05 11:05:09 +02:00
Franck Nijhof
7227f022b1 Upgrade pytest-asyncio to 0.18.3 and pytest-aiohttp to 1.0.4 (#3711) 2022-06-30 11:05:18 -07:00
dependabot[bot]
0ce91f2e25 Bump awesomeversion from 22.5.2 to 22.6.0 (#3706)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-30 10:57:39 +02:00
dependabot[bot]
fdb195cf59 Bump sentry-sdk from 1.5.12 to 1.6.0 (#3691)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-30 10:56:51 +02:00
Franck Nijhof
b85936774a Fix wheels build by pinning wheels action (#3710) 2022-06-30 10:07:39 +02:00
dependabot[bot]
bd106be026 Bump pylint from 2.14.3 to 2.14.4 (#3708)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-30 09:03:50 +02:00
dependabot[bot]
e588541fe3 Bump black from 22.3.0 to 22.6.0 (#3705)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-28 10:01:02 +02:00
Mike Degatano
d685d8539b Get version info from installed addon (#3702)
* Get version info from installed addon

* addon.slug not self.slug
2022-06-27 22:25:38 +02:00
Mike Degatano
bb3b8891bc AddonStore is_installed needs to check installed (#3701) 2022-06-27 17:46:42 +02:00
Joakim Sørensen
44e4e727cc Use checkonline instead of version for online check (#3700) 2022-06-27 16:29:16 +02:00
dependabot[bot]
acc49579f6 Bump time-machine from 2.7.0 to 2.7.1 (#3699)
Bumps [time-machine](https://github.com/adamchainz/time-machine) from 2.7.0 to 2.7.1.
- [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.7.0...2.7.1)

---
updated-dependencies:
- dependency-name: time-machine
  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-06-27 09:42:43 +02:00
dependabot[bot]
48eb1e8958 Bump home-assistant/builder from 2022.06.1 to 2022.06.2 (#3696)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-24 08:54:33 +02:00
Joakim Sørensen
a5e3f6f0b4 Remove installed key from store list API (#3695) 2022-06-24 07:50:05 +02:00
Joakim Sørensen
d309524fe7 Add back missing state to addons list API (#3694) 2022-06-24 07:49:35 +02:00
10 changed files with 31 additions and 22 deletions

View File

@@ -91,7 +91,7 @@ jobs:
- name: Build wheels
if: needs.init.outputs.requirements == 'true'
uses: home-assistant/wheels@master
uses: home-assistant/wheels@2022.01.2
with:
tag: ${{ env.WHEELS_TAG }}
arch: ${{ matrix.arch }}
@@ -128,7 +128,7 @@ jobs:
run: echo "BUILD_ARGS=--test" >> $GITHUB_ENV
- name: Build supervisor
uses: home-assistant/builder@2022.06.1
uses: home-assistant/builder@2022.06.2
with:
args: |
$BUILD_ARGS \
@@ -213,7 +213,7 @@ jobs:
- name: Build the Supervisor
if: needs.init.outputs.publish != 'true'
uses: home-assistant/builder@2022.06.1
uses: home-assistant/builder@2022.06.2
with:
args: |
--test \

View File

@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 22.6.0
hooks:
- id: black
args:

2
pytest.ini Normal file
View File

@@ -0,0 +1,2 @@
[pytest]
asyncio_mode = auto

View File

@@ -3,13 +3,13 @@ aiohttp==3.8.1
async_timeout==4.0.2
atomicwrites==1.4.0
attrs==21.4.0
awesomeversion==22.5.2
awesomeversion==22.6.0
brotli==1.0.9
cchardet==2.1.7
ciso8601==2.2.0
colorlog==6.6.0
cpe==1.2.1
cryptography==36.0.2
cryptography==37.0.4
debugpy==1.6.0
deepmerge==1.0.1
dirhash==0.2.1
@@ -20,6 +20,6 @@ pulsectl==22.3.2
pyudev==0.23.2
ruamel.yaml==0.17.17
securetar==2022.2.0
sentry-sdk==1.5.12
sentry-sdk==1.6.0
voluptuous==0.13.1
dbus-next==0.2.3

View File

@@ -1,15 +1,15 @@
black==22.3.0
black==22.6.0
codecov==2.1.12
coverage==6.4.1
flake8-docstrings==1.6.0
flake8==4.0.1
pre-commit==2.19.0
pydocstyle==6.1.1
pylint==2.14.3
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)
pylint==2.14.4
pytest-aiohttp==1.0.4
pytest-asyncio==0.18.3
pytest-cov==3.0.0
pytest-timeout==2.1.0
pytest==7.1.2
pyupgrade==2.34.0
time-machine==2.7.0
time-machine==2.7.1

View File

@@ -52,7 +52,6 @@ from ..const import (
ATTR_INGRESS_PANEL,
ATTR_INGRESS_PORT,
ATTR_INGRESS_URL,
ATTR_INSTALLED,
ATTR_IP_ADDRESS,
ATTR_KERNEL_MODULES,
ATTR_LOGO,
@@ -158,10 +157,10 @@ class APIAddons(CoreSysAttributes):
ATTR_VERSION: addon.version,
ATTR_VERSION_LATEST: addon.latest_version,
ATTR_UPDATE_AVAILABLE: addon.need_update,
ATTR_INSTALLED: addon.is_installed,
ATTR_AVAILABLE: addon.available,
ATTR_DETACHED: addon.is_detached,
ATTR_HOMEASSISTANT: addon.homeassistant_version,
ATTR_STATE: addon.state,
ATTR_REPOSITORY: addon.repository,
ATTR_BUILD: addon.need_build,
ATTR_URL: addon.url,

View File

@@ -103,6 +103,12 @@ class APIStore(CoreSysAttributes):
) -> dict[str, Any]:
"""Generate addon information."""
installed = (
self.sys_addons.get(addon.slug, local_only=True)
if addon.is_installed
else None
)
data = {
ATTR_ADVANCED: addon.advanced,
ATTR_ARCH: addon.supported_arch,
@@ -118,10 +124,12 @@ class APIStore(CoreSysAttributes):
ATTR_REPOSITORY: addon.repository,
ATTR_SLUG: addon.slug,
ATTR_STAGE: addon.stage,
ATTR_UPDATE_AVAILABLE: addon.need_update if addon.is_installed else False,
ATTR_UPDATE_AVAILABLE: installed.need_update
if addon.is_installed
else False,
ATTR_URL: addon.url,
ATTR_VERSION_LATEST: addon.latest_version,
ATTR_VERSION: addon.version if addon.is_installed else None,
ATTR_VERSION: installed.version if addon.is_installed else None,
}
if extended:
data.update(

View File

@@ -56,10 +56,10 @@ class DockerInfo:
def new(data: dict[str, Any]):
"""Create a object from docker info."""
return DockerInfo(
AwesomeVersion(data["ServerVersion"]),
data["Driver"],
data["LoggingDriver"],
data["CgroupVersion"],
AwesomeVersion(data.get("ServerVersion", "0.0.0")),
data.get("Driver", "unknown"),
data.get("LoggingDriver", "unknown"),
data.get("CgroupVersion", "1"),
)
@property

View File

@@ -21,7 +21,7 @@ class AddonStore(AddonModel):
@property
def is_installed(self) -> bool:
"""Return True if an add-on is installed."""
return False
return self.sys_addons.get(self.slug, local_only=True) is not None
@property
def is_detached(self) -> bool:

View File

@@ -248,7 +248,7 @@ class Supervisor(CoreSysAttributes):
timeout = aiohttp.ClientTimeout(total=10)
try:
await self.sys_websession.head(
"https://version.home-assistant.io/online.txt", timeout=timeout
"https://checkonline.home-assistant.io/online.txt", timeout=timeout
)
except (ClientError, asyncio.TimeoutError):
self.connectivity = False