Get supervisor client in analytics only on systems with supervisor (#126375)

fix supervisor dependency
This commit is contained in:
Michael 2024-09-21 11:29:28 +02:00 committed by GitHub
parent c07db352f3
commit 91c1e75c00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -177,7 +177,6 @@ class Analytics:
hass = self.hass
supervisor_info = None
operating_system_info: dict[str, Any] = {}
supervisor_client = hassio.get_supervisor_client(hass)
if not self.onboarded or not self.preferences.get(ATTR_BASE, False):
LOGGER.debug("Nothing to submit")
@ -262,6 +261,7 @@ class Analytics:
integrations.append(integration.domain)
if supervisor_info is not None:
supervisor_client = hassio.get_supervisor_client(hass)
installed_addons = await asyncio.gather(
*(
supervisor_client.addons.addon_info(addon[ATTR_SLUG])