mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Remove async_setup from hyperion (#93894)
This commit is contained in:
parent
4e5902c15b
commit
4f153a8f90
@ -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: {},
|
||||||
|
@ -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,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user