8000 Move async_setup_services to async_setup by chemelli74 · Pull Request #146048 · home-assistant/core · GitHub
[go: up one dir, main page]

Skip to content

Move async_setup_services to async_setup #146048

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
8000
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions homeassistant/components/google_mail/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@


async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Google Mail platform."""
"""Set up the Google Mail integration."""
hass.data.setdefault(DOMAIN, {})[DATA_HASS_CONFIG] = config

await async_setup_services(hass)

return True


Expand All @@ -52,8 +54,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: GoogleMailConfigEntry) -
entry, [platform for platform in PLATFORMS if platform != Platform.NOTIFY]
)

await async_setup_services(hass)

return True


Expand Down
3 changes: 2 additions & 1 deletion homeassistant/components/homematicip_cloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
)
)

await async_setup_services(hass)

return True


Expand All @@ -83,7 +85,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: HomematicIPConfigEntry)
if not await hap.async_setup():
return False

await async_setup_services(hass)
_async_remove_obsolete_entities(hass, entry, hap)

# Register on HA stop event to gracefully shutdown HomematicIP Cloud connection
Expand Down
12 changes: 9 additions & 3 deletions homeassistant/components/isy994/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
device_registry as dr,
)
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.typing import ConfigType

from .const import (
_LOGGER,
Expand Down Expand Up @@ -55,6 +56,14 @@
)


async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the ISY 994 integration."""

async_setup_services(hass)

return True


async def async_setup_entry(hass: HomeAssistant, entry: IsyConfigEntry) -> bool:
"""Set up the ISY 994 integration."""
isy_config = entry.data
Expand Down Expand Up @@ -167,9 +176,6 @@ def _async_stop_auto_update(event: Event) -> None:
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_stop_auto_update)
)

# Register Integration-wide Services:
async_setup_services(hass)

return True


Expand Down
16 changes: 12 additions & 4 deletions homeassistant/components/synology_dsm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from homeassistant.const import CONF_MAC, CONF_SCAN_INTERVAL, CONF_VERIFY_SSL
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers import config_validation as cv, device_registry as dr
from homeassistant.helpers.typing import ConfigType

from .common import SynoApi, raise_config_entry_auth_error
from .const import (
Expand All @@ -38,6 +39,16 @@

_LOGGER = logging.getLogger(__name__)

CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)


async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Synology DSM component."""

await async_setup_services(hass)

return True


async def async_setup_entry(hass: HomeAssistant, entry: SynologyDSMConfigEntry) -> bool:
"""Set up Synology DSM sensors."""
Expand Down Expand Up @@ -89,9 +100,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: SynologyDSMConfigEntry)
details = EXCEPTION_UNKNOWN
raise ConfigEntryNotReady(details) from err

# Services
await async_setup_services(hass)

# For SSDP compat
if not entry.data.get(CONF_MAC):
hass.config_entries.async_update_entry(
Expand Down
Loading
0