This commit is contained in:
epenet 2025-06-03 09:26:49 +02:00 committed by GitHub
parent f03dc5bb36
commit cfd99affa5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,7 +29,8 @@ Minimum change is to simply adjust the decorator
# Old
# def register_services(hass: HomeAssistant) -> None:
# @verify_domain_control(hass, DOMAIN)
# async def do_action(hass: HomeAssistant, call: ServiceCall) -> None:
# async def do_action(call: ServiceCall) -> None:
# entries = hass.config_entries.async_entries(DOMAIN)
# ...
# hass.services.async_register(...)
@ -37,6 +38,7 @@ Minimum change is to simply adjust the decorator
def register_services(hass: HomeAssistant) -> None:
@verify_domain_entity_control(DOMAIN)
async def do_action(call: ServiceCall) -> None:
entries = hass.config_entries.async_entries(DOMAIN)
...
hass.services.async_register(...)