Remove learn more URL from Home Assistant alerts (#75838)

pull/76119/head
Paulus Schoutsen 2022-07-27 12:59:43 -07:00 committed by Franck Nijhof
parent 15e6fcca41
commit 96587c1227
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
3 changed files with 5 additions and 49 deletions

View File

@ -75,7 +75,6 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
DOMAIN,
issue_id,
is_fixable=False,
learn_more_url=alert.alert_url,
severity=IssueSeverity.WARNING,
translation_key="alert",
translation_placeholders={
@ -112,7 +111,6 @@ class IntegrationAlert:
integration: str
filename: str
date_updated: str | None
alert_url: str | None
@property
def issue_id(self) -> str:
@ -147,7 +145,7 @@ class AlertUpdateCoordinator(DataUpdateCoordinator[dict[str, IntegrationAlert]])
result = {}
for alert in alerts:
if "alert_url" not in alert or "integrations" not in alert:
if "integrations" not in alert:
continue
if "homeassistant" in alert:
@ -177,7 +175,6 @@ class AlertUpdateCoordinator(DataUpdateCoordinator[dict[str, IntegrationAlert]])
integration=integration["package"],
filename=alert["filename"],
date_updated=alert.get("date_updated"),
alert_url=alert["alert_url"],
)
result[integration_alert.issue_id] = integration_alert

View File

@ -1,34 +0,0 @@
[
{
"title": "Dark Sky API closed for new users",
"created": "2020-03-31T14:40:00.000Z",
"integrations": [
{
"package": "darksky"
}
],
"github_issue": "https://github.com/home-assistant/home-assistant.io/pull/12591",
"homeassistant": {
"package": "homeassistant",
"affected_from_version": "0.30"
},
"filename": "dark_sky.markdown",
"alert_url": "https://alerts.home-assistant.io/#dark_sky.markdown"
},
{
"title": "Hikvision Security Vulnerability",
"created": "2021-09-20T22:08:00.000Z",
"integrations": [
{
"package": "hikvision"
},
{
"package": "hikvisioncam"
}
],
"filename": "hikvision.markdown",
"homeassistant": {
"package": "homeassistant"
}
}
]

View File

@ -133,7 +133,7 @@ async def test_alerts(
"ignored": False,
"is_fixable": False,
"issue_id": f"{alert}_{integration}",
"learn_more_url": f"https://alerts.home-assistant.io/#{alert}",
"learn_more_url": None,
"severity": "warning",
"translation_key": "alert",
"translation_placeholders": {
@ -149,13 +149,6 @@ async def test_alerts(
@pytest.mark.parametrize(
"ha_version, fixture, expected_alerts",
(
(
"2022.7.0",
"alerts_no_url.json",
[
("dark_sky.markdown", "darksky"),
],
),
(
"2022.7.0",
"alerts_no_integrations.json",
@ -220,7 +213,7 @@ async def test_bad_alerts(
"ignored": False,
"is_fixable": False,
"issue_id": f"{alert}_{integration}",
"learn_more_url": f"https://alerts.home-assistant.io/#{alert}",
"learn_more_url": None,
"severity": "warning",
"translation_key": "alert",
"translation_placeholders": {
@ -381,7 +374,7 @@ async def test_alerts_change(
"ignored": False,
"is_fixable": False,
"issue_id": f"{alert}_{integration}",
"learn_more_url": f"https://alerts.home-assistant.io/#{alert}",
"learn_more_url": None,
"severity": "warning",
"translation_key": "alert",
"translation_placeholders": {
@ -420,7 +413,7 @@ async def test_alerts_change(
"ignored": False,
"is_fixable": False,
"issue_id": f"{alert}_{integration}",
"learn_more_url": f"https://alerts.home-assistant.io/#{alert}",
"learn_more_url": None,
"severity": "warning",
"translation_key": "alert",
"translation_placeholders": {