8000 Move async_setup_services to async_setup (#146048) · home-assistant/core@7427db7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7427db7

Browse files
authored
Move async_setup_services to async_setup (#146048)
* Moved async_setup_services to async_setup * fix schema missing
1 parent 77d5bff commit 7427db7

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

homeassistant/components/google_mail/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@
2424

2525

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

30+
await async_setup_services(hass)
31+
3032
return True
3133

3234

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

55-
await async_setup_services(hass)
56-
5757
return True
5858

5959

homeassistant/components/homematicip_cloud/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
6363
)
6464
)
6565

66+
await async_setup_services(hass)
67+
6668
return True
6769

6870

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

86-
await async_setup_services(hass)
8788
_async_remove_obsolete_entities(hass, entry, hap)
8889

8990
# Register on HA stop event to gracefully shutdown HomematicIP Cloud connection

homeassistant/components/isy994/__init__.py

Lines changed: 9 additions & 3 deletions
< 10000 tr class="diff-line-row">
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
device_registry as dr,
2727
)
2828
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
29+
from homeassistant.helpers.typing import ConfigType
2930

3031
from .const import (
3132
_LOGGER,
@@ -55,6 +56,14 @@
5556
)
5657

5758

59+
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
60+
"""Set up the ISY 994 integration."""
61+
62+
async_setup_services(hass)
63+
64+
return True
65+
66+
5867
async def async_setup_entry(hass: HomeAssistant, entry: IsyConfigEntry) -> bool:
5968
"""Set up the ISY 994 integration."""
6069
isy_config = entry.data
@@ -167,9 +176,6 @@ def _async_stop_auto_update(event: Event) -> None:
167176
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_stop_auto_update)
168177
)
169178

170-
# Register Integration-wide Services:
171-
async_setup_services(hass)
172-
173179
return True
174180

175181

homeassistant/components/synology_dsm/__init__.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
from homeassistant.const import CONF_MAC, CONF_SCAN_INTERVAL, CONF_VERIFY_SSL
1313
from homeassistant.core import HomeAssistant
1414
from homeassistant.exceptions import ConfigEntryNotReady
15-
from homeassistant.helpers import device_registry as dr
15+
from homeassistant.helpers import config_validation as cv, device_registry as dr
16+
from homeassistant.helpers.typing import ConfigType
1617

1718
from .common import SynoApi, raise_config_entry_auth_error
1819
from .const import (
@@ -38,6 +39,16 @@
3839

3940
_LOGGER = logging.getLogger(__name__)
4041

42+
CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
43+
44+
45+
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
46+
"""Set up the Synology DSM component."""
47+
48+
await async_setup_services(hass)
49+
50+
return True
51+
4152

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

92-
# Services
93-
await async_setup_services(hass)
94-
95103
# For SSDP compat
96104
if not entry.data.get(CONF_MAC):
97105
hass.config_entries.async_update_entry(

0 commit comments

Comments
 (0)
0