Add certificate status for cloud remote (#91277)
This commit is contained in:
parent
d6c954a909
commit
2c8b704a6d
5 changed files with 11 additions and 1 deletions
|
@ -485,6 +485,7 @@ async def _account_data(hass: HomeAssistant, cloud: Cloud):
|
|||
"logged_in": True,
|
||||
"prefs": client.prefs.as_dict(),
|
||||
"remote_certificate": certificate,
|
||||
"remote_certificate_status": remote.certificate_status,
|
||||
"remote_connected": remote.is_connected,
|
||||
"remote_domain": remote.instance_domain,
|
||||
"http_use_ssl": hass.config.api.use_ssl,
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
"can_reach_cert_server": "Reach Certificate Server",
|
||||
"can_reach_cloud": "Reach Home Assistant Cloud",
|
||||
"can_reach_cloud_auth": "Reach Authentication Server",
|
||||
"certificate_status": "Certificate Status",
|
||||
"relayer_connected": "Relayer Connected",
|
||||
"relayer_region": "Relayer Region",
|
||||
"remote_connected": "Remote Connected",
|
||||
|
|
|
@ -34,6 +34,7 @@ async def system_health_info(hass):
|
|||
data["alexa_enabled"] = client.prefs.alexa_enabled
|
||||
data["google_enabled"] = client.prefs.google_enabled
|
||||
data["remote_server"] = cloud.remote.snitun_server
|
||||
data["certificate_status"] = cloud.remote.certificate_status
|
||||
|
||||
data["can_reach_cert_server"] = system_health.async_check_can_reach_url(
|
||||
hass, f"https://{cloud.acme_server}/directory"
|
||||
|
|
|
@ -429,6 +429,7 @@ async def test_websocket_status(
|
|||
"google_local_connected": False,
|
||||
"remote_domain": None,
|
||||
"remote_connected": False,
|
||||
"remote_certificate_status": None,
|
||||
"remote_certificate": None,
|
||||
"http_use_ssl": False,
|
||||
"active_subscription": False,
|
||||
|
|
|
@ -3,6 +3,7 @@ import asyncio
|
|||
from unittest.mock import Mock
|
||||
|
||||
from aiohttp import ClientError
|
||||
from hass_nabucasa.remote import CertificateStatus
|
||||
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
@ -32,7 +33,11 @@ async def test_cloud_system_health(
|
|||
relayer_server="cloud.bla.com",
|
||||
acme_server="cert-server",
|
||||
is_logged_in=True,
|
||||
remote=Mock(is_connected=False, snitun_server="us-west-1"),
|
||||
remote=Mock(
|
||||
is_connected=False,
|
||||
snitun_server="us-west-1",
|
||||
certificate_status=CertificateStatus.READY,
|
||||
),
|
||||
expiration_date=now,
|
||||
is_connected=True,
|
||||
client=Mock(
|
||||
|
@ -54,6 +59,7 @@ async def test_cloud_system_health(
|
|||
assert info == {
|
||||
"logged_in": True,
|
||||
"subscription_expiration": now,
|
||||
"certificate_status": "ready",
|
||||
"relayer_connected": True,
|
||||
"relayer_region": "xx-earth-616",
|
||||
"remote_enabled": True,
|
||||
|
|
Loading…
Add table
Reference in a new issue