Break up websocket component (#17003)
* Break up websocket component * Lint
This commit is contained in:
parent
9edf1e5151
commit
22a80cf733
21 changed files with 1041 additions and 1003 deletions
|
@ -4,6 +4,7 @@ import voluptuous as vol
|
|||
from homeassistant.auth.providers import homeassistant as auth_ha
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.components import websocket_api
|
||||
from homeassistant.components.websocket_api.decorators import require_owner
|
||||
|
||||
|
||||
WS_TYPE_CREATE = 'config/auth_provider/homeassistant/create'
|
||||
|
@ -55,7 +56,7 @@ def _get_provider(hass):
|
|||
|
||||
|
||||
@callback
|
||||
@websocket_api.require_owner
|
||||
@require_owner
|
||||
def websocket_create(hass, connection, msg):
|
||||
"""Create credentials and attach to a user."""
|
||||
async def create_creds():
|
||||
|
@ -96,7 +97,7 @@ def websocket_create(hass, connection, msg):
|
|||
|
||||
|
||||
@callback
|
||||
@websocket_api.require_owner
|
||||
@require_owner
|
||||
def websocket_delete(hass, connection, msg):
|
||||
"""Delete username and related credential."""
|
||||
async def delete_creds():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue