Prevent redundant call to async_is_supervisor
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Thu, 22 Aug 2024 05:59:05 +0000 (07:59 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Thu, 22 Aug 2024 05:59:05 +0000 (07:59 +0200)
music_assistant/server/providers/hass/__init__.py

index 4966c8365f5607040718d5428d68835dd54fa57e..5b1cd6482acec9d1d193a760d873bb2b16cf0b67 100644 (file)
@@ -17,7 +17,6 @@ import shortuuid
 from hass_client import HomeAssistantClient
 from hass_client.exceptions import BaseHassClientError
 from hass_client.utils import (
-    async_is_supervisor,
     base_url,
     get_auth_url,
     get_long_lived_token,
@@ -93,7 +92,7 @@ async def get_config_entries(
         # set the retrieved token on the values object to pass along
         values[CONF_AUTH_TOKEN] = long_lived_token
 
-    if await async_is_supervisor():
+    if mass.running_as_hass_addon:
         # on supervisor, we use the internal url
         # token set to None for auto retrieval
         return (