Add repair warning about UniFi Protect Early Access (#81658)
parent
b18a1e6d7c
commit
6c659c0d68
|
@ -21,8 +21,9 @@ from homeassistant.const import (
|
|||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
from homeassistant.helpers import device_registry as dr, issue_registry as ir
|
||||
from homeassistant.helpers.aiohttp_client import async_create_clientsession
|
||||
from homeassistant.helpers.issue_registry import IssueSeverity
|
||||
|
||||
from .const import (
|
||||
CONF_ALL_UPDATES,
|
||||
|
@ -101,6 +102,20 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, data_service.async_stop)
|
||||
)
|
||||
|
||||
protect_version = data_service.api.bootstrap.nvr.version
|
||||
if protect_version.is_prerelease:
|
||||
ir.async_create_issue(
|
||||
hass,
|
||||
DOMAIN,
|
||||
f"ea_warning_{protect_version}",
|
||||
is_fixable=False,
|
||||
is_persistent=False,
|
||||
learn_more_url="https://www.home-assistant.io/integrations/unifiprotect#about-unifi-early-access",
|
||||
severity=IssueSeverity.WARNING,
|
||||
translation_key="ea_warning",
|
||||
translation_placeholders={"version": str(protect_version)},
|
||||
)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
|
|
@ -54,5 +54,11 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"ea_warning": {
|
||||
"title": "{version} is an Early Access version of UniFi Protect",
|
||||
"description": "You are using {version} of UniFi Protect. Early Access versions are not supported by Home Assistant and may cause your UniFi Protect integration to break or not work as expected."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,16 +41,18 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"issues": {
|
||||
"ea_warning": {
|
||||
"description": "You are using {version} of UniFi Protect. Early Access versions are not supported by Home Assistant and may cause your UniFi Protect integration to break or not work as expected.",
|
||||
"title": "{version} is an Early Access version of UniFi Protect"
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"error": {
|
||||
"invalid_mac_list": "Must be a list of MAC addresses seperated by commas"
|
||||
},
|
||||
"step": {
|
||||
"init": {
|
||||
"data": {
|
||||
"all_updates": "Realtime metrics (WARNING: Greatly increases CPU usage)",
|
||||
"disable_rtsp": "Disable the RTSP stream",
|
||||
"ignored_devices": "Comma separated list of MAC addresses of devices to ignore",
|
||||
"max_media": "Max number of event to load for Media Browser (increases RAM usage)",
|
||||
"override_connection_host": "Override Connection Host"
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue