Add icon translations to Environment Canada (#111527)

* Add icon translations to Environment Canada

* Add icon translations to Environment Canada
pull/111709/head
Joost Lekkerkerker 2024-02-28 08:50:31 +01:00 committed by GitHub
parent dfd8179a2d
commit e2c38c6415
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 5 deletions

View File

@ -0,0 +1,24 @@
{
"entity": {
"sensor": {
"advisories": {
"default": "mdi:bell-alert"
},
"endings": {
"default": "mdi:alert-circle-check"
},
"statements": {
"default": "mdi:bell-alert"
},
"warnings": {
"default": "mdi:alert-octagon"
},
"watches": {
"default": "mdi:alert"
}
}
},
"services": {
"set_radar_type": "mdi:radar"
}
}

View File

@ -235,35 +235,30 @@ ALERT_TYPES: tuple[ECSensorEntityDescription, ...] = (
ECSensorEntityDescription(
key="advisories",
translation_key="advisories",
icon="mdi:bell-alert",
value_fn=lambda data: data.alerts.get("advisories", {}).get("value"),
transform=len,
),
ECSensorEntityDescription(
key="endings",
translation_key="endings",
icon="mdi:alert-circle-check",
value_fn=lambda data: data.alerts.get("endings", {}).get("value"),
transform=len,
),
ECSensorEntityDescription(
key="statements",
translation_key="statements",
icon="mdi:bell-alert",
value_fn=lambda data: data.alerts.get("statements", {}).get("value"),
transform=len,
),
ECSensorEntityDescription(
key="warnings",
translation_key="warnings",
icon="mdi:alert-octagon",
value_fn=lambda data: data.alerts.get("warnings", {}).get("value"),
transform=len,
),
ECSensorEntityDescription(
key="watches",
translation_key="watches",
icon="mdi:alert",
value_fn=lambda data: data.alerts.get("watches", {}).get("value"),
transform=len,
),