diff --git a/homeassistant/components/evohome/__init__.py b/homeassistant/components/evohome/__init__.py index 9dce352df30..7b7f8225063 100644 --- a/homeassistant/components/evohome/__init__.py +++ b/homeassistant/components/evohome/__init__.py @@ -162,12 +162,12 @@ def setup_service_functions( It appears that all TCC-compatible systems support the same three zones modes. """ - @verify_domain_control(hass, DOMAIN) + @verify_domain_control(DOMAIN) async def force_refresh(call: ServiceCall) -> None: """Obtain the latest state data via the vendor's RESTful API.""" await coordinator.async_refresh() - @verify_domain_control(hass, DOMAIN) + @verify_domain_control(DOMAIN) async def set_system_mode(call: ServiceCall) -> None: """Set the system mode.""" assert coordinator.tcs is not None # mypy @@ -179,7 +179,7 @@ def setup_service_functions( } async_dispatcher_send(hass, DOMAIN, payload) - @verify_domain_control(hass, DOMAIN) + @verify_domain_control(DOMAIN) async def set_zone_override(call: ServiceCall) -> None: """Set the zone override (setpoint).""" entity_id = call.data[ATTR_ENTITY_ID] diff --git a/homeassistant/components/geniushub/__init__.py b/homeassistant/components/geniushub/__init__.py index 9ca6ecfcfe0..9bc645c6391 100644 --- a/homeassistant/components/geniushub/__init__.py +++ b/homeassistant/components/geniushub/__init__.py @@ -124,7 +124,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: GeniusHubConfigEntry) -> def setup_service_functions(hass: HomeAssistant, broker): """Set up the service functions.""" - @verify_domain_control(hass, DOMAIN) + @verify_domain_control(DOMAIN) async def set_zone_mode(call: ServiceCall) -> None: """Set the system mode.""" entity_id = call.data[ATTR_ENTITY_ID] diff --git a/homeassistant/components/homematicip_cloud/services.py b/homeassistant/components/homematicip_cloud/services.py index 1cfb3a55552..9e663ae5490 100644 --- a/homeassistant/components/homematicip_cloud/services.py +++ b/homeassistant/components/homematicip_cloud/services.py @@ -124,7 +124,7 @@ SCHEMA_SET_HOME_COOLING_MODE = vol.Schema( def async_setup_services(hass: HomeAssistant) -> None: """Set up the HomematicIP Cloud services.""" - @verify_domain_control(hass, DOMAIN) + @verify_domain_control(DOMAIN) async def async_call_hmipc_service(service: ServiceCall) -> None: """Call correct HomematicIP Cloud service.""" service_name = service.service diff --git a/homeassistant/components/hue/services.py b/homeassistant/components/hue/services.py index 0fd6e8bdae0..1a70e98e5b3 100644 --- a/homeassistant/components/hue/services.py +++ b/homeassistant/components/hue/services.py @@ -64,7 +64,7 @@ def async_setup_services(hass: HomeAssistant) -> None: hass.services.async_register( DOMAIN, SERVICE_HUE_ACTIVATE_SCENE, - verify_domain_control(hass, DOMAIN)(hue_activate_scene), + verify_domain_control(DOMAIN)(hue_activate_scene), schema=vol.Schema( { vol.Required(ATTR_GROUP_NAME): cv.string, diff --git a/homeassistant/components/monoprice/media_player.py b/homeassistant/components/monoprice/media_player.py index 9d678c16874..734dbecd88b 100644 --- a/homeassistant/components/monoprice/media_player.py +++ b/homeassistant/components/monoprice/media_player.py @@ -89,7 +89,7 @@ async def async_setup_entry( elif service_call.service == SERVICE_RESTORE: entity.restore() - @service.verify_domain_control(hass, DOMAIN) + @service.verify_domain_control(DOMAIN) async def async_service_handle(service_call: core.ServiceCall) -> None: """Handle for services.""" entities = await platform.async_extract_from_service(service_call) diff --git a/homeassistant/components/simplisafe/__init__.py b/homeassistant/components/simplisafe/__init__.py index 8a75baa69c6..d716c0a73a2 100644 --- a/homeassistant/components/simplisafe/__init__.py +++ b/homeassistant/components/simplisafe/__init__.py @@ -290,7 +290,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: """Set up SimpliSafe as config entry.""" _async_standardize_config_entry(hass, entry) - _verify_domain_control = verify_domain_control(hass, DOMAIN) + _verify_domain_control = verify_domain_control(DOMAIN) websession = aiohttp_client.async_get_clientsession(hass) try: diff --git a/homeassistant/components/sonos/media_player.py b/homeassistant/components/sonos/media_player.py index 6fb7bf00589..21ed70a117b 100644 --- a/homeassistant/components/sonos/media_player.py +++ b/homeassistant/components/sonos/media_player.py @@ -126,7 +126,7 @@ async def async_setup_entry( _LOGGER.debug("Creating media_player on %s", speaker.zone_name) async_add_entities([SonosMediaPlayerEntity(speaker, config_entry)]) - @service.verify_domain_control(hass, DOMAIN) + @service.verify_domain_control(DOMAIN) async def async_service_handle(service_call: ServiceCall) -> None: """Handle dispatched services.""" assert platform is not None diff --git a/homeassistant/helpers/service.py b/homeassistant/helpers/service.py index 5cd48e09ef6..ca4d8561b2e 100644 --- a/homeassistant/helpers/service.py +++ b/homeassistant/helpers/service.py @@ -9,7 +9,7 @@ from enum import Enum from functools import cache, partial import logging from types import ModuleType -from typing import TYPE_CHECKING, Any, TypedDict, cast, overload, override +from typing import TYPE_CHECKING, Any, TypedDict, cast, override import voluptuous as vol @@ -986,19 +986,7 @@ def async_register_admin_service( ) -# Overloads can be dropped when all core calls have been updated to drop hass argument -@overload -def verify_domain_control( - domain: str, -) -> Callable[[Callable[[ServiceCall], Any]], Callable[[ServiceCall], Any]]: ... -@overload -def verify_domain_control( - hass: HomeAssistant, - domain: str, -) -> Callable[[Callable[[ServiceCall], Any]], Callable[[ServiceCall], Any]]: ... - - -@deprecate_hass_binding(breaks_in_ha_version="2026.2") # type: ignore[misc] +@deprecate_hass_binding(breaks_in_ha_version="2026.2") @callback def verify_domain_control( domain: str,