From 4f153a8f9093f8a66713fd38f277b6f33089cfba Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 1 Jun 2023 12:20:04 +0200 Subject: [PATCH] Remove async_setup from hyperion (#93894) --- homeassistant/components/hyperion/__init__.py | 8 +------- tests/components/hyperion/test_config_flow.py | 6 +----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/hyperion/__init__.py b/homeassistant/components/hyperion/__init__.py index 6c2842c190e..ea038b3b408 100644 --- a/homeassistant/components/hyperion/__init__.py +++ b/homeassistant/components/hyperion/__init__.py @@ -19,7 +19,6 @@ from homeassistant.helpers.dispatcher import ( async_dispatcher_connect, async_dispatcher_send, ) -from homeassistant.helpers.typing import ConfigType from .const import ( CONF_INSTANCE_CLIENTS, @@ -104,12 +103,6 @@ async def async_create_connect_hyperion_client( return hyperion_client -async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: - """Set up Hyperion component.""" - hass.data[DOMAIN] = {} - return True - - @callback def listen_for_instance_updates( hass: HomeAssistant, @@ -191,6 +184,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: # We need 1 root client (to manage instances being removed/added) and then 1 client # per Hyperion server instance which is shared for all entities associated with # that instance. + hass.data.setdefault(DOMAIN, {}) hass.data[DOMAIN][entry.entry_id] = { CONF_ROOT_CLIENT: hyperion_client, CONF_INSTANCE_CLIENTS: {}, diff --git a/tests/components/hyperion/test_config_flow.py b/tests/components/hyperion/test_config_flow.py index ad71f392bc6..635fd24a795 100644 --- a/tests/components/hyperion/test_config_flow.py +++ b/tests/components/hyperion/test_config_flow.py @@ -150,8 +150,6 @@ async def _configure_flow( user_input = user_input or {} with patch( - "homeassistant.components.hyperion.async_setup", return_value=True - ), patch( "homeassistant.components.hyperion.async_setup_entry", return_value=True, ): @@ -836,9 +834,7 @@ async def test_reauth_success(hass: HomeAssistant) -> None: with patch( "homeassistant.components.hyperion.client.HyperionClient", return_value=client - ), patch("homeassistant.components.hyperion.async_setup", return_value=True), patch( - "homeassistant.components.hyperion.async_setup_entry", return_value=True - ): + ), patch("homeassistant.components.hyperion.async_setup_entry", return_value=True): result = await _init_flow( hass, source=SOURCE_REAUTH,