mirror of https://github.com/home-assistant/core
Bump Home Assistant Cloud 0.12 (#23159)
* Home Assistant Cloud 0.12 * Fix raising error * Fix requirements * Fix lint
This commit is contained in:
parent
0b7e62f737
commit
073f947ca4
|
@ -189,7 +189,12 @@ async def async_setup(hass, config):
|
|||
hass.helpers.service.async_register_admin_service(
|
||||
DOMAIN, SERVICE_REMOTE_DISCONNECT, _service_handler)
|
||||
|
||||
async def _on_connect():
|
||||
"""Discover RemoteUI binary sensor."""
|
||||
hass.async_create_task(hass.helpers.discovery.async_load_platform(
|
||||
'binary_sensor', DOMAIN, {}, config))
|
||||
|
||||
cloud.iot.register_on_connect(_on_connect)
|
||||
|
||||
await http_api.async_setup(hass)
|
||||
hass.async_create_task(hass.helpers.discovery.async_load_platform(
|
||||
'binary_sensor', DOMAIN, {}, config))
|
||||
return True
|
||||
|
|
|
@ -150,8 +150,11 @@ class CloudClient(Interface):
|
|||
)
|
||||
|
||||
# Fix AgentUserId
|
||||
cloud = self._hass.data[DOMAIN]
|
||||
answer['payload']['agentUserId'] = cloud.claims['cognito:username']
|
||||
try:
|
||||
cloud = self._hass.data[DOMAIN]
|
||||
answer['payload']['agentUserId'] = cloud.claims['cognito:username']
|
||||
except (TypeError, KeyError):
|
||||
return ga.turned_off_response(payload)
|
||||
|
||||
return answer
|
||||
|
||||
|
|
|
@ -105,6 +105,8 @@ async def async_setup(hass):
|
|||
(400, "User does not exist."),
|
||||
auth.UserNotConfirmed:
|
||||
(400, 'Email not confirmed.'),
|
||||
auth.UserExists:
|
||||
(400, 'An account with the given email already exists.'),
|
||||
auth.Unauthenticated:
|
||||
(401, 'Authentication failed.'),
|
||||
auth.PasswordChangeRequired:
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"name": "Cloud",
|
||||
"documentation": "https://www.home-assistant.io/components/cloud",
|
||||
"requirements": [
|
||||
"hass-nabucasa==0.11"
|
||||
"hass-nabucasa==0.12"
|
||||
],
|
||||
"dependencies": [
|
||||
"http",
|
||||
|
|
|
@ -518,7 +518,7 @@ habitipy==0.2.0
|
|||
hangups==0.4.6
|
||||
|
||||
# homeassistant.components.cloud
|
||||
hass-nabucasa==0.11
|
||||
hass-nabucasa==0.12
|
||||
|
||||
# homeassistant.components.mqtt
|
||||
hbmqtt==0.9.4
|
||||
|
|
|
@ -124,7 +124,7 @@ ha-ffmpeg==2.0
|
|||
hangups==0.4.6
|
||||
|
||||
# homeassistant.components.cloud
|
||||
hass-nabucasa==0.11
|
||||
hass-nabucasa==0.12
|
||||
|
||||
# homeassistant.components.mqtt
|
||||
hbmqtt==0.9.4
|
||||
|
|
|
@ -11,6 +11,15 @@ async def test_remote_connection_sensor(hass):
|
|||
bin_sensor.WAIT_UNTIL_CHANGE = 0
|
||||
|
||||
assert await async_setup_component(hass, 'cloud', {'cloud': {}})
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert hass.states.get('binary_sensor.remote_ui') is None
|
||||
|
||||
# Fake connection/discovery
|
||||
org_cloud = hass.data['cloud']
|
||||
await org_cloud.iot._on_connect[-1]()
|
||||
|
||||
# Mock test env
|
||||
cloud = hass.data['cloud'] = Mock()
|
||||
cloud.remote.certificate = None
|
||||
await hass.async_block_till_done()
|
||||
|
|
Loading…
Reference in New Issue