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_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: {},

View File

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