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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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):