Add icon translations to Season (#112221)
This commit is contained in:
parent
47b7333d99
commit
3c12f6339e
2 changed files with 15 additions and 11 deletions
15
homeassistant/components/season/icons.json
Normal file
15
homeassistant/components/season/icons.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"entity": {
|
||||
"sensor": {
|
||||
"season": {
|
||||
"default": "mdi:cloud",
|
||||
"state": {
|
||||
"spring": "mdi:flower",
|
||||
"summer": "mdi:sunglasses",
|
||||
"autumn": "mdi:leaf",
|
||||
"winter": "mdi:snowflake"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -32,13 +32,6 @@ HEMISPHERE_SEASON_SWAP = {
|
|||
STATE_SUMMER: STATE_WINTER,
|
||||
}
|
||||
|
||||
SEASON_ICONS = {
|
||||
STATE_SPRING: "mdi:flower",
|
||||
STATE_SUMMER: "mdi:sunglasses",
|
||||
STATE_AUTUMN: "mdi:leaf",
|
||||
STATE_WINTER: "mdi:snowflake",
|
||||
}
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
|
@ -113,7 +106,3 @@ class SeasonSensorEntity(SensorEntity):
|
|||
self._attr_native_value = get_season(
|
||||
utcnow().replace(tzinfo=None), self.hemisphere, self.type
|
||||
)
|
||||
|
||||
self._attr_icon = "mdi:cloud"
|
||||
if self._attr_native_value:
|
||||
self._attr_icon = SEASON_ICONS[self._attr_native_value]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue