Remove async_setup from hyperion (#93894)

This commit is contained in:
Erik Montnemery 2023-06-01 12:20:04 +02:00 committed by GitHub
parent 4e5902c15b
commit 4f153a8f90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 12 deletions

View File

@ -19,7 +19,6 @@ from homeassistant.helpers.dispatcher import (
async_dispatcher_connect, async_dispatcher_connect,
async_dispatcher_send, async_dispatcher_send,
) )
from homeassistant.helpers.typing import ConfigType
from .const import ( from .const import (
CONF_INSTANCE_CLIENTS, CONF_INSTANCE_CLIENTS,
@ -104,12 +103,6 @@ async def async_create_connect_hyperion_client(
return hyperion_client return hyperion_client
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up Hyperion component."""
hass.data[DOMAIN] = {}
return True
@callback @callback
def listen_for_instance_updates( def listen_for_instance_updates(
hass: HomeAssistant, 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 # 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 # per Hyperion server instance which is shared for all entities associated with
# that instance. # that instance.
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = { hass.data[DOMAIN][entry.entry_id] = {
CONF_ROOT_CLIENT: hyperion_client, CONF_ROOT_CLIENT: hyperion_client,
CONF_INSTANCE_CLIENTS: {}, CONF_INSTANCE_CLIENTS: {},

View File

@ -150,8 +150,6 @@ async def _configure_flow(
user_input = user_input or {} user_input = user_input or {}
with patch( with patch(
"homeassistant.components.hyperion.async_setup", return_value=True
), patch(
"homeassistant.components.hyperion.async_setup_entry", "homeassistant.components.hyperion.async_setup_entry",
return_value=True, return_value=True,
): ):
@ -836,9 +834,7 @@ async def test_reauth_success(hass: HomeAssistant) -> None:
with patch( with patch(
"homeassistant.components.hyperion.client.HyperionClient", return_value=client "homeassistant.components.hyperion.client.HyperionClient", return_value=client
), patch("homeassistant.components.hyperion.async_setup", return_value=True), patch( ), patch("homeassistant.components.hyperion.async_setup_entry", return_value=True):
"homeassistant.components.hyperion.async_setup_entry", return_value=True
):
result = await _init_flow( result = await _init_flow(
hass, hass,
source=SOURCE_REAUTH, source=SOURCE_REAUTH,