Mobile App: Remove component loading support (#23025)
Loading a component defined in a registration didn't actually work and was undocumented, so let's just remove it instead of fixing #23005. ## Checklist: - [X] The code change is tested and works locally. - [X] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass** - [X] There is no commented out code in this PR.
This commit is contained in:
parent
7e39e14086
commit
7303d56a55
3 changed files with 4 additions and 50 deletions
|
@ -12,15 +12,11 @@ from homeassistant.components.http import HomeAssistantView
|
|||
from homeassistant.components.http.data_validator import RequestDataValidator
|
||||
from homeassistant.const import (HTTP_CREATED, CONF_WEBHOOK_ID)
|
||||
|
||||
from homeassistant.loader import get_component
|
||||
from .const import (ATTR_DEVICE_ID, ATTR_SUPPORTS_ENCRYPTION,
|
||||
CONF_CLOUDHOOK_URL, CONF_REMOTE_UI_URL, CONF_SECRET,
|
||||
CONF_USER_ID, DOMAIN, REGISTRATION_SCHEMA)
|
||||
|
||||
from .const import (ATTR_APP_COMPONENT, ATTR_DEVICE_ID,
|
||||
ATTR_SUPPORTS_ENCRYPTION, CONF_CLOUDHOOK_URL,
|
||||
CONF_REMOTE_UI_URL, CONF_SECRET,
|
||||
CONF_USER_ID, DOMAIN, ERR_INVALID_COMPONENT,
|
||||
REGISTRATION_SCHEMA)
|
||||
|
||||
from .helpers import error_response, supports_encryption
|
||||
from .helpers import supports_encryption
|
||||
|
||||
|
||||
class RegistrationsView(HomeAssistantView):
|
||||
|
@ -34,20 +30,6 @@ class RegistrationsView(HomeAssistantView):
|
|||
"""Handle the POST request for registration."""
|
||||
hass = request.app['hass']
|
||||
|
||||
if ATTR_APP_COMPONENT in data:
|
||||
component = get_component(hass, data[ATTR_APP_COMPONENT])
|
||||
if component is None:
|
||||
fmt_str = "{} is not a valid component."
|
||||
msg = fmt_str.format(data[ATTR_APP_COMPONENT])
|
||||
return error_response(ERR_INVALID_COMPONENT, msg)
|
||||
|
||||
if (hasattr(component, 'DEPENDENCIES') is False or
|
||||
(hasattr(component, 'DEPENDENCIES') and
|
||||
DOMAIN not in component.DEPENDENCIES)):
|
||||
fmt_str = "{} is not compatible with mobile_app."
|
||||
msg = fmt_str.format(data[ATTR_APP_COMPONENT])
|
||||
return error_response(ERR_INVALID_COMPONENT, msg)
|
||||
|
||||
webhook_id = generate_secret()
|
||||
|
||||
if hass.components.cloud.async_active_subscription():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue