Bump hass-nabucasa from 0.56.0 to 0.59.0 (#82987)

* Bump hass-nabucasa from 0.56.0 to 0.58.0

* 0.59.0
pull/83042/head
Joakim Sørensen 2022-12-01 09:08:39 +01:00 committed by GitHub
parent 38b9d896b2
commit 817bbfe6aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 64 additions and 64 deletions

View File

@ -36,22 +36,23 @@ from homeassistant.util.aiohttp import MockRequest
from . import account_link, http_api from . import account_link, http_api
from .client import CloudClient from .client import CloudClient
from .const import ( from .const import (
CONF_ACCOUNT_LINK_URL, CONF_ACCOUNT_LINK_SERVER,
CONF_ACME_DIRECTORY_SERVER, CONF_ACCOUNTS_SERVER,
CONF_ACME_SERVER,
CONF_ALEXA, CONF_ALEXA,
CONF_ALEXA_ACCESS_TOKEN_URL, CONF_ALEXA_SERVER,
CONF_ALIASES, CONF_ALIASES,
CONF_CLOUDHOOK_CREATE_URL, CONF_CLOUDHOOK_SERVER,
CONF_COGNITO_CLIENT_ID, CONF_COGNITO_CLIENT_ID,
CONF_ENTITY_CONFIG, CONF_ENTITY_CONFIG,
CONF_FILTER, CONF_FILTER,
CONF_GOOGLE_ACTIONS, CONF_GOOGLE_ACTIONS,
CONF_GOOGLE_ACTIONS_REPORT_STATE_URL, CONF_RELAYER_SERVER,
CONF_RELAYER, CONF_REMOTE_SNI_SERVER,
CONF_REMOTE_API_URL, CONF_REMOTESTATE_SERVER,
CONF_SUBSCRIPTION_INFO_URL, CONF_THINGTALK_SERVER,
CONF_USER_POOL_ID, CONF_USER_POOL_ID,
CONF_VOICE_API_URL, CONF_VOICE_SERVER,
DOMAIN, DOMAIN,
MODE_DEV, MODE_DEV,
MODE_PROD, MODE_PROD,
@ -107,17 +108,18 @@ CONFIG_SCHEMA = vol.Schema(
vol.Optional(CONF_COGNITO_CLIENT_ID): str, vol.Optional(CONF_COGNITO_CLIENT_ID): str,
vol.Optional(CONF_USER_POOL_ID): str, vol.Optional(CONF_USER_POOL_ID): str,
vol.Optional(CONF_REGION): str, vol.Optional(CONF_REGION): str,
vol.Optional(CONF_RELAYER): str,
vol.Optional(CONF_SUBSCRIPTION_INFO_URL): vol.Url(),
vol.Optional(CONF_CLOUDHOOK_CREATE_URL): vol.Url(),
vol.Optional(CONF_REMOTE_API_URL): vol.Url(),
vol.Optional(CONF_ACME_DIRECTORY_SERVER): vol.Url(),
vol.Optional(CONF_ALEXA): ALEXA_SCHEMA, vol.Optional(CONF_ALEXA): ALEXA_SCHEMA,
vol.Optional(CONF_GOOGLE_ACTIONS): GACTIONS_SCHEMA, vol.Optional(CONF_GOOGLE_ACTIONS): GACTIONS_SCHEMA,
vol.Optional(CONF_ALEXA_ACCESS_TOKEN_URL): vol.Url(), vol.Optional(CONF_ACCOUNT_LINK_SERVER): str,
vol.Optional(CONF_GOOGLE_ACTIONS_REPORT_STATE_URL): vol.Url(), vol.Optional(CONF_ACCOUNTS_SERVER): str,
vol.Optional(CONF_ACCOUNT_LINK_URL): vol.Url(), vol.Optional(CONF_ACME_SERVER): str,
vol.Optional(CONF_VOICE_API_URL): vol.Url(), vol.Optional(CONF_ALEXA_SERVER): str,
vol.Optional(CONF_CLOUDHOOK_SERVER): str,
vol.Optional(CONF_RELAYER_SERVER): str,
vol.Optional(CONF_REMOTE_SNI_SERVER): str,
vol.Optional(CONF_REMOTESTATE_SERVER): str,
vol.Optional(CONF_THINGTALK_SERVER): str,
vol.Optional(CONF_VOICE_SERVER): str,
} }
) )
}, },

View File

@ -47,16 +47,18 @@ CONF_COGNITO_CLIENT_ID = "cognito_client_id"
CONF_ENTITY_CONFIG = "entity_config" CONF_ENTITY_CONFIG = "entity_config"
CONF_FILTER = "filter" CONF_FILTER = "filter"
CONF_GOOGLE_ACTIONS = "google_actions" CONF_GOOGLE_ACTIONS = "google_actions"
CONF_RELAYER = "relayer"
CONF_USER_POOL_ID = "user_pool_id" CONF_USER_POOL_ID = "user_pool_id"
CONF_SUBSCRIPTION_INFO_URL = "subscription_info_url"
CONF_CLOUDHOOK_CREATE_URL = "cloudhook_create_url" CONF_ACCOUNT_LINK_SERVER = "account_link_server"
CONF_REMOTE_API_URL = "remote_api_url" CONF_ACCOUNTS_SERVER = "accounts_server"
CONF_ACME_DIRECTORY_SERVER = "acme_directory_server" CONF_ACME_SERVER = "acme_server"
CONF_ALEXA_ACCESS_TOKEN_URL = "alexa_access_token_url" CONF_ALEXA_SERVER = "alexa_server"
CONF_GOOGLE_ACTIONS_REPORT_STATE_URL = "google_actions_report_state_url" CONF_CLOUDHOOK_SERVER = "cloudhook_server"
CONF_ACCOUNT_LINK_URL = "account_link_url" CONF_RELAYER_SERVER = "relayer_server"
CONF_VOICE_API_URL = "voice_api_url" CONF_REMOTE_SNI_SERVER = "remote_sni_server"
CONF_REMOTESTATE_SERVER = "remotestate_server"
CONF_THINGTALK_SERVER = "thingtalk_server"
CONF_VOICE_SERVER = "voice_server"
MODE_DEV = "development" MODE_DEV = "development"
MODE_PROD = "production" MODE_PROD = "production"

View File

@ -2,7 +2,7 @@
"domain": "cloud", "domain": "cloud",
"name": "Home Assistant Cloud", "name": "Home Assistant Cloud",
"documentation": "https://www.home-assistant.io/integrations/cloud", "documentation": "https://www.home-assistant.io/integrations/cloud",
"requirements": ["hass-nabucasa==0.56.0"], "requirements": ["hass-nabucasa==0.59.0"],
"dependencies": ["http", "webhook"], "dependencies": ["http", "webhook"],
"after_dependencies": ["google_assistant", "alexa"], "after_dependencies": ["google_assistant", "alexa"],
"codeowners": ["@home-assistant/cloud"], "codeowners": ["@home-assistant/cloud"],

View File

@ -1,6 +1,5 @@
"""Provide info to system health.""" """Provide info to system health."""
from hass_nabucasa import Cloud from hass_nabucasa import Cloud
from yarl import URL
from homeassistant.components import system_health from homeassistant.components import system_health
from homeassistant.core import HomeAssistant, callback from homeassistant.core import HomeAssistant, callback
@ -36,14 +35,14 @@ async def system_health_info(hass):
data["remote_server"] = cloud.remote.snitun_server data["remote_server"] = cloud.remote.snitun_server
data["can_reach_cert_server"] = system_health.async_check_can_reach_url( data["can_reach_cert_server"] = system_health.async_check_can_reach_url(
hass, cloud.acme_directory_server hass, f"https://{cloud.acme_server}/directory"
) )
data["can_reach_cloud_auth"] = system_health.async_check_can_reach_url( data["can_reach_cloud_auth"] = system_health.async_check_can_reach_url(
hass, hass,
f"https://cognito-idp.{cloud.region}.amazonaws.com/{cloud.user_pool_id}/.well-known/jwks.json", f"https://cognito-idp.{cloud.region}.amazonaws.com/{cloud.user_pool_id}/.well-known/jwks.json",
) )
data["can_reach_cloud"] = system_health.async_check_can_reach_url( data["can_reach_cloud"] = system_health.async_check_can_reach_url(
hass, URL(cloud.relayer).with_scheme("https").with_path("/status") hass, f"https://{cloud.relayer_server}/status"
) )
return data return data

View File

@ -20,7 +20,7 @@ ciso8601==2.2.0
cryptography==38.0.3 cryptography==38.0.3
dbus-fast==1.75.0 dbus-fast==1.75.0
fnvhash==0.1.0 fnvhash==0.1.0
hass-nabucasa==0.56.0 hass-nabucasa==0.59.0
home-assistant-bluetooth==1.8.1 home-assistant-bluetooth==1.8.1
home-assistant-frontend==20221130.0 home-assistant-frontend==20221130.0
httpx==0.23.1 httpx==0.23.1

View File

@ -848,7 +848,7 @@ ha-philipsjs==2.9.0
habitipy==0.2.0 habitipy==0.2.0
# homeassistant.components.cloud # homeassistant.components.cloud
hass-nabucasa==0.56.0 hass-nabucasa==0.59.0
# homeassistant.components.splunk # homeassistant.components.splunk
hass_splunk==0.1.1 hass_splunk==0.1.1

View File

@ -640,7 +640,7 @@ ha-philipsjs==2.9.0
habitipy==0.2.0 habitipy==0.2.0
# homeassistant.components.cloud # homeassistant.components.cloud
hass-nabucasa==0.56.0 hass-nabucasa==0.59.0
# homeassistant.components.tasmota # homeassistant.components.tasmota
hatasmota==0.6.1 hatasmota==0.6.1

View File

@ -129,7 +129,7 @@ async def test_alexa_config_report_state(hass, cloud_prefs, cloud_stub):
async def test_alexa_config_invalidate_token(hass, cloud_prefs, aioclient_mock): async def test_alexa_config_invalidate_token(hass, cloud_prefs, aioclient_mock):
"""Test Alexa config should expose using prefs.""" """Test Alexa config should expose using prefs."""
aioclient_mock.post( aioclient_mock.post(
"http://example/alexa_token", "https://example/access_token",
json={ json={
"access_token": "mock-token", "access_token": "mock-token",
"event_endpoint": "http://example.com/alexa_endpoint", "event_endpoint": "http://example.com/alexa_endpoint",
@ -142,7 +142,7 @@ async def test_alexa_config_invalidate_token(hass, cloud_prefs, aioclient_mock):
"mock-user-id", "mock-user-id",
cloud_prefs, cloud_prefs,
Mock( Mock(
alexa_access_token_url="http://example/alexa_token", alexa_server="example",
auth=Mock(async_check_token=AsyncMock()), auth=Mock(async_check_token=AsyncMock()),
websession=async_get_clientsession(hass), websession=async_get_clientsession(hass),
), ),
@ -181,7 +181,7 @@ async def test_alexa_config_fail_refresh_token(
"""Test Alexa config failing to refresh token.""" """Test Alexa config failing to refresh token."""
aioclient_mock.post( aioclient_mock.post(
"http://example/alexa_token", "https://example/access_token",
json={ json={
"access_token": "mock-token", "access_token": "mock-token",
"event_endpoint": "http://example.com/alexa_endpoint", "event_endpoint": "http://example.com/alexa_endpoint",
@ -198,7 +198,7 @@ async def test_alexa_config_fail_refresh_token(
"mock-user-id", "mock-user-id",
cloud_prefs, cloud_prefs,
Mock( Mock(
alexa_access_token_url="http://example/alexa_token", alexa_server="example",
auth=Mock(async_check_token=AsyncMock()), auth=Mock(async_check_token=AsyncMock()),
websession=async_get_clientsession(hass), websession=async_get_clientsession(hass),
), ),
@ -228,7 +228,7 @@ async def test_alexa_config_fail_refresh_token(
conf.async_invalidate_access_token() conf.async_invalidate_access_token()
aioclient_mock.clear_requests() aioclient_mock.clear_requests()
aioclient_mock.post( aioclient_mock.post(
"http://example/alexa_token", "https://example/access_token",
json={"reason": reject_reason}, json={"reason": reject_reason},
status=400, status=400,
) )
@ -254,7 +254,7 @@ async def test_alexa_config_fail_refresh_token(
# State reporting should now be re-enabled for Alexa # State reporting should now be re-enabled for Alexa
aioclient_mock.clear_requests() aioclient_mock.clear_requests()
aioclient_mock.post( aioclient_mock.post(
"http://example/alexa_token", "https://example/access_token",
json={ json={
"access_token": "mock-token", "access_token": "mock-token",
"event_endpoint": "http://example.com/alexa_endpoint", "event_endpoint": "http://example.com/alexa_endpoint",

View File

@ -21,7 +21,7 @@ from . import mock_cloud, mock_cloud_prefs
from tests.components.google_assistant import MockConfig from tests.components.google_assistant import MockConfig
SUBSCRIPTION_INFO_URL = "https://api-test.hass.io/subscription_info" SUBSCRIPTION_INFO_URL = "https://api-test.hass.io/payments/subscription_info"
@pytest.fixture(name="mock_cloud_login") @pytest.fixture(name="mock_cloud_login")
@ -48,8 +48,8 @@ def setup_api_fixture(hass, aioclient_mock):
"cognito_client_id": "cognito_client_id", "cognito_client_id": "cognito_client_id",
"user_pool_id": "user_pool_id", "user_pool_id": "user_pool_id",
"region": "region", "region": "region",
"relayer": "relayer", "relayer_server": "relayer",
"subscription_info_url": SUBSCRIPTION_INFO_URL, "accounts_server": "api-test.hass.io",
"google_actions": {"filter": {"include_domains": "light"}}, "google_actions": {"filter": {"include_domains": "light"}},
"alexa": { "alexa": {
"filter": {"include_entities": ["light.kitchen", "switch.ac"]} "filter": {"include_entities": ["light.kitchen", "switch.ac"]}

View File

@ -26,13 +26,13 @@ async def test_constructor_loads_info_from_config(hass):
"cognito_client_id": "test-cognito_client_id", "cognito_client_id": "test-cognito_client_id",
"user_pool_id": "test-user_pool_id", "user_pool_id": "test-user_pool_id",
"region": "test-region", "region": "test-region",
"relayer": "test-relayer", "relayer_server": "test-relayer-server",
"subscription_info_url": "http://test-subscription-info-url", "accounts_server": "test-acounts-server",
"cloudhook_create_url": "http://test-cloudhook_create_url", "cloudhook_server": "test-cloudhook-server",
"remote_api_url": "http://test-remote_api_url", "remote_sni_server": "test-remote-sni-server",
"alexa_access_token_url": "http://test-alexa-token-url", "alexa_server": "test-alexa-server",
"acme_directory_server": "http://test-acme-directory-server", "acme_server": "test-acme-server",
"google_actions_report_state_url": "http://test-google-actions-report-state-url", "remotestate_server": "test-remotestate-server",
}, },
}, },
) )
@ -43,16 +43,13 @@ async def test_constructor_loads_info_from_config(hass):
assert cl.cognito_client_id == "test-cognito_client_id" assert cl.cognito_client_id == "test-cognito_client_id"
assert cl.user_pool_id == "test-user_pool_id" assert cl.user_pool_id == "test-user_pool_id"
assert cl.region == "test-region" assert cl.region == "test-region"
assert cl.relayer == "test-relayer" assert cl.relayer_server == "test-relayer-server"
assert cl.subscription_info_url == "http://test-subscription-info-url" assert cl.iot.ws_server_url == "wss://test-relayer-server/websocket"
assert cl.cloudhook_create_url == "http://test-cloudhook_create_url" assert cl.accounts_server == "test-acounts-server"
assert cl.remote_api_url == "http://test-remote_api_url" assert cl.cloudhook_server == "test-cloudhook-server"
assert cl.alexa_access_token_url == "http://test-alexa-token-url" assert cl.alexa_server == "test-alexa-server"
assert cl.acme_directory_server == "http://test-acme-directory-server" assert cl.acme_server == "test-acme-server"
assert ( assert cl.remotestate_server == "test-remotestate-server"
cl.google_actions_report_state_url
== "http://test-google-actions-report-state-url"
)
async def test_remote_services(hass, mock_cloud_fixture, hass_read_only_user): async def test_remote_services(hass, mock_cloud_fixture, hass_read_only_user):
@ -120,7 +117,7 @@ async def test_setup_existing_cloud_user(hass, hass_storage):
"cognito_client_id": "test-cognito_client_id", "cognito_client_id": "test-cognito_client_id",
"user_pool_id": "test-user_pool_id", "user_pool_id": "test-user_pool_id",
"region": "test-region", "region": "test-region",
"relayer": "test-relayer", "relayer_server": "test-relayer-serer",
}, },
}, },
) )

View File

@ -13,7 +13,7 @@ from tests.common import get_system_health_info
async def test_cloud_system_health(hass, aioclient_mock): async def test_cloud_system_health(hass, aioclient_mock):
"""Test cloud system health.""" """Test cloud system health."""
aioclient_mock.get("https://cloud.bla.com/status", text="") aioclient_mock.get("https://cloud.bla.com/status", text="")
aioclient_mock.get("https://cert-server", text="") aioclient_mock.get("https://cert-server/directory", text="")
aioclient_mock.get( aioclient_mock.get(
"https://cognito-idp.us-east-1.amazonaws.com/AAAA/.well-known/jwks.json", "https://cognito-idp.us-east-1.amazonaws.com/AAAA/.well-known/jwks.json",
exc=ClientError, exc=ClientError,
@ -25,8 +25,8 @@ async def test_cloud_system_health(hass, aioclient_mock):
hass.data["cloud"] = Mock( hass.data["cloud"] = Mock(
region="us-east-1", region="us-east-1",
user_pool_id="AAAA", user_pool_id="AAAA",
relayer="wss://cloud.bla.com/websocket_api", relayer_server="cloud.bla.com",
acme_directory_server="https://cert-server", acme_server="cert-server",
is_logged_in=True, is_logged_in=True,
remote=Mock(is_connected=False, snitun_server="us-west-1"), remote=Mock(is_connected=False, snitun_server="us-west-1"),
expiration_date=now, expiration_date=now,