diff --git a/homeassistant/components/google_mail/__init__.py b/homeassistant/components/google_mail/__init__.py index 8ef978568dc..4b530eef605 100644 --- a/homeassistant/components/google_mail/__init__.py +++ b/homeassistant/components/google_mail/__init__.py @@ -24,9 +24,11 @@ CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) 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 @@ -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 diff --git a/homeassistant/components/homematicip_cloud/__init__.py b/homeassistant/components/homematicip_cloud/__init__.py index e460c162398..fcb71efc2b0 100644 --- a/homeassistant/components/homematicip_cloud/__init__.py +++ b/homeassistant/components/homematicip_cloud/__init__.py @@ -63,6 +63,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: ) ) + await async_setup_services(hass) + return True @@ -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 diff --git a/homeassistant/components/isy994/__init__.py b/homeassistant/components/isy994/__init__.py index bed86b2d0fe..2f3b56aad0d 100644 --- a/homeassistant/components/isy994/__init__.py +++ b/homeassistant/components/isy994/__init__.py @@ -26,6 +26,7 @@ from homeassistant.helpers import ( device_registry as dr, ) from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo +from homeassistant.helpers.typing import ConfigType from .const import ( _LOGGER, @@ -55,6 +56,14 @@ CONFIG_SCHEMA = vol.Schema( ) +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 @@ -167,9 +176,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: IsyConfigEntry) -> bool: hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_stop_auto_update) ) - # Register Integration-wide Services: - async_setup_services(hass) - return True diff --git a/homeassistant/components/synology_dsm/__init__.py b/homeassistant/components/synology_dsm/__init__.py index d9319beb595..ce90aacc9cf 100644 --- a/homeassistant/components/synology_dsm/__init__.py +++ b/homeassistant/components/synology_dsm/__init__.py @@ -12,7 +12,8 @@ from synology_dsm.exceptions import SynologyDSMNotLoggedInException 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 ( @@ -38,6 +39,16 @@ from .service import async_setup_services _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.""" @@ -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(