Skip to content

Commit 22a14da

Browse files
authored
Rename service registration method (home-assistant#146615)
1 parent 20f5d85 commit 22a14da

File tree

20 files changed

+46
-38
lines changed

20 files changed

+46
-38
lines changed

homeassistant/components/bosch_alarm/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from homeassistant.helpers.typing import ConfigType
1515

1616
from .const import CONF_INSTALLER_CODE, CONF_USER_CODE, DOMAIN
17-
from .services import setup_services
17+
from .services import async_setup_services
1818
from .types import BoschAlarmConfigEntry
1919

2020
CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
@@ -29,7 +29,7 @@
2929

3030
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
3131
"""Set up bosch alarm services."""
32-
setup_services(hass)
32+
async_setup_services(hass)
3333
return True
3434

3535

homeassistant/components/bosch_alarm/services.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import voluptuous as vol
1010

1111
from homeassistant.config_entries import ConfigEntryState
12-
from homeassistant.core import HomeAssistant, ServiceCall
12+
from homeassistant.core import HomeAssistant, ServiceCall, callback
1313
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
1414
from homeassistant.helpers import config_validation as cv
1515
from homeassistant.util import dt as dt_util
@@ -66,7 +66,8 @@ async def async_set_panel_date(call: ServiceCall) -> None:
6666
) from err
6767

6868

69-
def setup_services(hass: HomeAssistant) -> None:
69+
@callback
70+
def async_setup_services(hass: HomeAssistant) -> None:
7071
"""Set up the services for the bosch alarm integration."""
7172

7273
hass.services.async_register(

homeassistant/components/dynalite/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from .const import DOMAIN, LOGGER, PLATFORMS
1313
from .convert_config import convert_config
1414
from .panel import async_register_dynalite_frontend
15-
from .services import setup_services
15+
from .services import async_setup_services
1616

1717
CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
1818

@@ -21,7 +21,7 @@
2121

2222
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
2323
"""Set up the Dynalite platform."""
24-
setup_services(hass)
24+
async_setup_services(hass)
2525

2626
await async_register_dynalite_frontend(hass)
2727

homeassistant/components/dynalite/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ async def _request_channel_level(service_call: ServiceCall) -> None:
5050

5151

5252
@callback
53-
def setup_services(hass: HomeAssistant) -> None:
53+
def async_setup_services(hass: HomeAssistant) -> None:
5454
"""Set up the Dynalite platform."""
5555
hass.services.async_register(
5656
DOMAIN,

homeassistant/components/guardian/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
SIGNAL_PAIRED_SENSOR_COORDINATOR_ADDED,
2828
)
2929
from .coordinator import GuardianDataUpdateCoordinator
30-
from .services import setup_services
30+
from .services import async_setup_services
3131

3232
CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
3333

@@ -55,7 +55,7 @@ class GuardianData:
5555

5656
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
5757
"""Set up the Elexa Guardian component."""
58-
setup_services(hass)
58+
async_setup_services(hass)
5959
return True
6060

6161

homeassistant/components/guardian/services.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ async def async_upgrade_firmware(call: ServiceCall, data: GuardianData) -> None:
122122
)
123123

124124

125-
def setup_services(hass: HomeAssistant) -> None:
126-
"""Register the Renault services."""
125+
@callback
126+
def async_setup_services(hass: HomeAssistant) -> None:
127+
"""Register the guardian services."""
127128
for service_name, schema, method in (
128129
(
129130
SERVICE_NAME_PAIR_SENSOR,

homeassistant/components/heos/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from homeassistant.helpers import config_validation as cv, device_registry as dr
1010
from homeassistant.helpers.typing import ConfigType
1111

12-
from . import services
1312
from .const import DOMAIN
1413
from .coordinator import HeosConfigEntry, HeosCoordinator
14+
from .services import async_setup_services
1515

1616
PLATFORMS = [Platform.MEDIA_PLAYER]
1717

@@ -22,7 +22,7 @@
2222

2323
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
2424
"""Set up the HEOS component."""
25-
services.register(hass)
25+
async_setup_services(hass)
2626
return True
2727

2828

homeassistant/components/heos/services.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from homeassistant.components.media_player import ATTR_MEDIA_VOLUME_LEVEL
1111
from homeassistant.config_entries import ConfigEntryState
12-
from homeassistant.core import HomeAssistant, ServiceCall, SupportsResponse
12+
from homeassistant.core import HomeAssistant, ServiceCall, SupportsResponse, callback
1313
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
1414
from homeassistant.helpers import (
1515
config_validation as cv,
@@ -44,7 +44,8 @@
4444
HEOS_SIGN_OUT_SCHEMA = vol.Schema({})
4545

4646

47-
def register(hass: HomeAssistant) -> None:
47+
@callback
48+
def async_setup_services(hass: HomeAssistant) -> None:
4849
"""Register HEOS services."""
4950
hass.services.async_register(
5051
DOMAIN,

homeassistant/components/home_connect/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from .api import AsyncConfigEntryAuth
2424
from .const import DOMAIN, OLD_NEW_UNIQUE_ID_SUFFIX_MAP
2525
from .coordinator import HomeConnectConfigEntry, HomeConnectCoordinator
26-
from .services import register_actions
26+
from .services import async_setup_services
2727

2828
_LOGGER = logging.getLogger(__name__)
2929

@@ -43,7 +43,7 @@
4343

4444
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
4545
"""Set up Home Connect component."""
46-
register_actions(hass)
46+
async_setup_services(hass)
4747
return True
4848

4949

homeassistant/components/home_connect/services.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import voluptuous as vol
1919

2020
from homeassistant.const import ATTR_DEVICE_ID
21-
from homeassistant.core import HomeAssistant, ServiceCall
21+
from homeassistant.core import HomeAssistant, ServiceCall, callback
2222
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
2323
from homeassistant.helpers import config_validation as cv, device_registry as dr
2424
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
@@ -522,7 +522,8 @@ async def async_service_start_program(call: ServiceCall) -> None:
522522
await _async_service_program(call, True)
523523

524524

525-
def register_actions(hass: HomeAssistant) -> None:
525+
@callback
526+
def async_setup_services(hass: HomeAssistant) -> None:
526527
"""Register custom actions."""
527528

528529
hass.services.async_register(

0 commit comments

Comments
 (0)