mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Add if subscription is active to cloud status (#68266)
This commit is contained in:
parent
d021222d6d
commit
aabfa08834
@ -420,7 +420,11 @@ async def _account_data(hass: HomeAssistant, cloud: Cloud):
|
|||||||
"""Generate the auth data JSON response."""
|
"""Generate the auth data JSON response."""
|
||||||
|
|
||||||
if not cloud.is_logged_in:
|
if not cloud.is_logged_in:
|
||||||
return {"logged_in": False, "cloud": STATE_DISCONNECTED}
|
return {
|
||||||
|
"logged_in": False,
|
||||||
|
"cloud": STATE_DISCONNECTED,
|
||||||
|
"http_use_ssl": hass.config.api.use_ssl,
|
||||||
|
}
|
||||||
|
|
||||||
claims = cloud.claims
|
claims = cloud.claims
|
||||||
client = cloud.client
|
client = cloud.client
|
||||||
@ -457,6 +461,7 @@ async def _account_data(hass: HomeAssistant, cloud: Cloud):
|
|||||||
"remote_connected": remote.is_connected,
|
"remote_connected": remote.is_connected,
|
||||||
"remote_domain": remote.instance_domain,
|
"remote_domain": remote.instance_domain,
|
||||||
"http_use_ssl": hass.config.api.use_ssl,
|
"http_use_ssl": hass.config.api.use_ssl,
|
||||||
|
"active_subscription": not cloud.subscription_expired,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -430,6 +430,7 @@ async def test_websocket_status(
|
|||||||
"remote_connected": False,
|
"remote_connected": False,
|
||||||
"remote_certificate": None,
|
"remote_certificate": None,
|
||||||
"http_use_ssl": False,
|
"http_use_ssl": False,
|
||||||
|
"active_subscription": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -438,7 +439,11 @@ async def test_websocket_status_not_logged_in(hass, hass_ws_client):
|
|||||||
client = await hass_ws_client(hass)
|
client = await hass_ws_client(hass)
|
||||||
await client.send_json({"id": 5, "type": "cloud/status"})
|
await client.send_json({"id": 5, "type": "cloud/status"})
|
||||||
response = await client.receive_json()
|
response = await client.receive_json()
|
||||||
assert response["result"] == {"logged_in": False, "cloud": "disconnected"}
|
assert response["result"] == {
|
||||||
|
"logged_in": False,
|
||||||
|
"cloud": "disconnected",
|
||||||
|
"http_use_ssl": False,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async def test_websocket_subscription_info(
|
async def test_websocket_subscription_info(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user