1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Admin service to automatically add empty schema (#22637)

* Admin service to automatically add empty schema

* Lint
This commit is contained in:
Paulus Schoutsen
2019-04-02 09:34:11 -07:00
committed by GitHub
parent b8b3f4e88f
commit e00ae35e07
3 changed files with 25 additions and 8 deletions

View File

@@ -333,9 +333,10 @@ async def _handle_service_platform_call(func, data, entities, context):
@bind_hass
@ha.callback
def async_register_admin_service(hass: typing.HomeAssistantType, domain: str,
service: str, service_func: Callable,
schema: vol.Schema) -> None:
def async_register_admin_service(
hass: typing.HomeAssistantType, domain: str,
service: str, service_func: Callable,
schema: vol.Schema = vol.Schema({}, extra=vol.PREVENT_EXTRA)) -> None:
"""Register a service that requires admin access."""
@wraps(service_func)
async def admin_handler(call):