Remove learn more URL from Home Assistant alerts (#75838)
parent
15e6fcca41
commit
96587c1227
|
@ -75,7 +75,6 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
issue_id,
|
issue_id,
|
||||||
is_fixable=False,
|
is_fixable=False,
|
||||||
learn_more_url=alert.alert_url,
|
|
||||||
severity=IssueSeverity.WARNING,
|
severity=IssueSeverity.WARNING,
|
||||||
translation_key="alert",
|
translation_key="alert",
|
||||||
translation_placeholders={
|
translation_placeholders={
|
||||||
|
@ -112,7 +111,6 @@ class IntegrationAlert:
|
||||||
integration: str
|
integration: str
|
||||||
filename: str
|
filename: str
|
||||||
date_updated: str | None
|
date_updated: str | None
|
||||||
alert_url: str | None
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def issue_id(self) -> str:
|
def issue_id(self) -> str:
|
||||||
|
@ -147,7 +145,7 @@ class AlertUpdateCoordinator(DataUpdateCoordinator[dict[str, IntegrationAlert]])
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
for alert in alerts:
|
for alert in alerts:
|
||||||
if "alert_url" not in alert or "integrations" not in alert:
|
if "integrations" not in alert:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if "homeassistant" in alert:
|
if "homeassistant" in alert:
|
||||||
|
@ -177,7 +175,6 @@ class AlertUpdateCoordinator(DataUpdateCoordinator[dict[str, IntegrationAlert]])
|
||||||
integration=integration["package"],
|
integration=integration["package"],
|
||||||
filename=alert["filename"],
|
filename=alert["filename"],
|
||||||
date_updated=alert.get("date_updated"),
|
date_updated=alert.get("date_updated"),
|
||||||
alert_url=alert["alert_url"],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
result[integration_alert.issue_id] = integration_alert
|
result[integration_alert.issue_id] = integration_alert
|
||||||
|
|
|
@ -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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
|
@ -133,7 +133,7 @@ async def test_alerts(
|
||||||
"ignored": False,
|
"ignored": False,
|
||||||
"is_fixable": False,
|
"is_fixable": False,
|
||||||
"issue_id": f"{alert}_{integration}",
|
"issue_id": f"{alert}_{integration}",
|
||||||
"learn_more_url": f"https://alerts.home-assistant.io/#{alert}",
|
"learn_more_url": None,
|
||||||
"severity": "warning",
|
"severity": "warning",
|
||||||
"translation_key": "alert",
|
"translation_key": "alert",
|
||||||
"translation_placeholders": {
|
"translation_placeholders": {
|
||||||
|
@ -149,13 +149,6 @@ async def test_alerts(
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"ha_version, fixture, expected_alerts",
|
"ha_version, fixture, expected_alerts",
|
||||||
(
|
(
|
||||||
(
|
|
||||||
"2022.7.0",
|
|
||||||
"alerts_no_url.json",
|
|
||||||
[
|
|
||||||
("dark_sky.markdown", "darksky"),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
(
|
(
|
||||||
"2022.7.0",
|
"2022.7.0",
|
||||||
"alerts_no_integrations.json",
|
"alerts_no_integrations.json",
|
||||||
|
@ -220,7 +213,7 @@ async def test_bad_alerts(
|
||||||
"ignored": False,
|
"ignored": False,
|
||||||
"is_fixable": False,
|
"is_fixable": False,
|
||||||
"issue_id": f"{alert}_{integration}",
|
"issue_id": f"{alert}_{integration}",
|
||||||
"learn_more_url": f"https://alerts.home-assistant.io/#{alert}",
|
"learn_more_url": None,
|
||||||
"severity": "warning",
|
"severity": "warning",
|
||||||
"translation_key": "alert",
|
"translation_key": "alert",
|
||||||
"translation_placeholders": {
|
"translation_placeholders": {
|
||||||
|
@ -381,7 +374,7 @@ async def test_alerts_change(
|
||||||
"ignored": False,
|
"ignored": False,
|
||||||
"is_fixable": False,
|
"is_fixable": False,
|
||||||
"issue_id": f"{alert}_{integration}",
|
"issue_id": f"{alert}_{integration}",
|
||||||
"learn_more_url": f"https://alerts.home-assistant.io/#{alert}",
|
"learn_more_url": None,
|
||||||
"severity": "warning",
|
"severity": "warning",
|
||||||
"translation_key": "alert",
|
"translation_key": "alert",
|
||||||
"translation_placeholders": {
|
"translation_placeholders": {
|
||||||
|
@ -420,7 +413,7 @@ async def test_alerts_change(
|
||||||
"ignored": False,
|
"ignored": False,
|
||||||
"is_fixable": False,
|
"is_fixable": False,
|
||||||
"issue_id": f"{alert}_{integration}",
|
"issue_id": f"{alert}_{integration}",
|
||||||
"learn_more_url": f"https://alerts.home-assistant.io/#{alert}",
|
"learn_more_url": None,
|
||||||
"severity": "warning",
|
"severity": "warning",
|
||||||
"translation_key": "alert",
|
"translation_key": "alert",
|
||||||
"translation_placeholders": {
|
"translation_placeholders": {
|
||||||
|
|
Loading…
Reference in New Issue