mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
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(
|
hass.helpers.service.async_register_admin_service(
|
||||||
DOMAIN, SERVICE_REMOTE_DISCONNECT, _service_handler)
|
DOMAIN, SERVICE_REMOTE_DISCONNECT, _service_handler)
|
||||||
|
|
||||||
await http_api.async_setup(hass)
|
async def _on_connect():
|
||||||
|
"""Discover RemoteUI binary sensor."""
|
||||||
hass.async_create_task(hass.helpers.discovery.async_load_platform(
|
hass.async_create_task(hass.helpers.discovery.async_load_platform(
|
||||||
'binary_sensor', DOMAIN, {}, config))
|
'binary_sensor', DOMAIN, {}, config))
|
||||||
|
|
||||||
|
cloud.iot.register_on_connect(_on_connect)
|
||||||
|
|
||||||
|
await http_api.async_setup(hass)
|
||||||
return True
|
return True
|
||||||
|
@ -150,8 +150,11 @@ class CloudClient(Interface):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Fix AgentUserId
|
# Fix AgentUserId
|
||||||
|
try:
|
||||||
cloud = self._hass.data[DOMAIN]
|
cloud = self._hass.data[DOMAIN]
|
||||||
answer['payload']['agentUserId'] = cloud.claims['cognito:username']
|
answer['payload']['agentUserId'] = cloud.claims['cognito:username']
|
||||||
|
except (TypeError, KeyError):
|
||||||
|
return ga.turned_off_response(payload)
|
||||||
|
|
||||||
return answer
|
return answer
|
||||||
|
|
||||||
|
@ -105,6 +105,8 @@ async def async_setup(hass):
|
|||||||
(400, "User does not exist."),
|
(400, "User does not exist."),
|
||||||
auth.UserNotConfirmed:
|
auth.UserNotConfirmed:
|
||||||
(400, 'Email not confirmed.'),
|
(400, 'Email not confirmed.'),
|
||||||
|
auth.UserExists:
|
||||||
|
(400, 'An account with the given email already exists.'),
|
||||||
auth.Unauthenticated:
|
auth.Unauthenticated:
|
||||||
(401, 'Authentication failed.'),
|
(401, 'Authentication failed.'),
|
||||||
auth.PasswordChangeRequired:
|
auth.PasswordChangeRequired:
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Cloud",
|
"name": "Cloud",
|
||||||
"documentation": "https://www.home-assistant.io/components/cloud",
|
"documentation": "https://www.home-assistant.io/components/cloud",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"hass-nabucasa==0.11"
|
"hass-nabucasa==0.12"
|
||||||
],
|
],
|
||||||
"dependencies": [
|
"dependencies": [
|
||||||
"http",
|
"http",
|
||||||
|
@ -518,7 +518,7 @@ habitipy==0.2.0
|
|||||||
hangups==0.4.6
|
hangups==0.4.6
|
||||||
|
|
||||||
# homeassistant.components.cloud
|
# homeassistant.components.cloud
|
||||||
hass-nabucasa==0.11
|
hass-nabucasa==0.12
|
||||||
|
|
||||||
# homeassistant.components.mqtt
|
# homeassistant.components.mqtt
|
||||||
hbmqtt==0.9.4
|
hbmqtt==0.9.4
|
||||||
|
@ -124,7 +124,7 @@ ha-ffmpeg==2.0
|
|||||||
hangups==0.4.6
|
hangups==0.4.6
|
||||||
|
|
||||||
# homeassistant.components.cloud
|
# homeassistant.components.cloud
|
||||||
hass-nabucasa==0.11
|
hass-nabucasa==0.12
|
||||||
|
|
||||||
# homeassistant.components.mqtt
|
# homeassistant.components.mqtt
|
||||||
hbmqtt==0.9.4
|
hbmqtt==0.9.4
|
||||||
|
@ -11,6 +11,15 @@ async def test_remote_connection_sensor(hass):
|
|||||||
bin_sensor.WAIT_UNTIL_CHANGE = 0
|
bin_sensor.WAIT_UNTIL_CHANGE = 0
|
||||||
|
|
||||||
assert await async_setup_component(hass, 'cloud', {'cloud': {}})
|
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 = hass.data['cloud'] = Mock()
|
||||||
cloud.remote.certificate = None
|
cloud.remote.certificate = None
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user