From 3c12f6339e48ee73bb86d97c3b35c7524a5ea884 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Mon, 4 Mar 2024 16:53:10 +0100 Subject: [PATCH] Add icon translations to Season (#112221) --- homeassistant/components/season/icons.json | 15 +++++++++++++++ homeassistant/components/season/sensor.py | 11 ----------- 2 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 homeassistant/components/season/icons.json diff --git a/homeassistant/components/season/icons.json b/homeassistant/components/season/icons.json new file mode 100644 index 00000000000..160ab257338 --- /dev/null +++ b/homeassistant/components/season/icons.json @@ -0,0 +1,15 @@ +{ + "entity": { + "sensor": { + "season": { + "default": "mdi:cloud", + "state": { + "spring": "mdi:flower", + "summer": "mdi:sunglasses", + "autumn": "mdi:leaf", + "winter": "mdi:snowflake" + } + } + } + } +} diff --git a/homeassistant/components/season/sensor.py b/homeassistant/components/season/sensor.py index cfca3c1f9ea..aa0f6c80b19 100644 --- a/homeassistant/components/season/sensor.py +++ b/homeassistant/components/season/sensor.py @@ -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]