mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Only allow admins to enable remote connection (#22609)
* Only allow admins to enable remote connection * Protect WS API * Lint
This commit is contained in:
committed by
Pascal Vizeli
parent
282fd225c9
commit
c96804954c
@@ -187,10 +187,11 @@ async def async_setup(hass, config):
|
||||
await cloud.remote.disconnect()
|
||||
await prefs.async_update(remote_enabled=False)
|
||||
|
||||
hass.services.async_register(
|
||||
DOMAIN, SERVICE_REMOTE_CONNECT, _service_handler)
|
||||
hass.services.async_register(
|
||||
DOMAIN, SERVICE_REMOTE_DISCONNECT, _service_handler)
|
||||
empty_schema = vol.Schema({})
|
||||
hass.helpers.service.async_register_admin_service(
|
||||
DOMAIN, SERVICE_REMOTE_CONNECT, _service_handler, empty_schema)
|
||||
hass.helpers.service.async_register_admin_service(
|
||||
DOMAIN, SERVICE_REMOTE_DISCONNECT, _service_handler, empty_schema)
|
||||
|
||||
await http_api.async_setup(hass)
|
||||
hass.async_create_task(hass.helpers.discovery.async_load_platform(
|
||||
|
||||
Reference in New Issue
Block a user