Compare commits

...

7 Commits

Author SHA1 Message Date
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
6 changed files with 16 additions and 9 deletions

View File

@@ -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

@@ -12,4 +12,4 @@ 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

@@ -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