From d369447961ea52ab1da180ac99867fcb7a629c65 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 5 Mar 2024 21:50:32 +0100 Subject: [PATCH] Add icon translations to Twitch (#112329) --- homeassistant/components/twitch/icons.json | 9 +++++++++ homeassistant/components/twitch/sensor.py | 4 +--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 homeassistant/components/twitch/icons.json diff --git a/homeassistant/components/twitch/icons.json b/homeassistant/components/twitch/icons.json new file mode 100644 index 00000000000..54b07caf5f8 --- /dev/null +++ b/homeassistant/components/twitch/icons.json @@ -0,0 +1,9 @@ +{ + "entity": { + "sensor": { + "channel": { + "default": "mdi:twitch" + } + } + } +} diff --git a/homeassistant/components/twitch/sensor.py b/homeassistant/components/twitch/sensor.py index 05fd3fa3e71..c1af382ff86 100644 --- a/homeassistant/components/twitch/sensor.py +++ b/homeassistant/components/twitch/sensor.py @@ -46,8 +46,6 @@ ATTR_FOLLOW_SINCE = "following_since" ATTR_FOLLOWING = "followers" ATTR_VIEWS = "views" -ICON = "mdi:twitch" - STATE_OFFLINE = "offline" STATE_STREAMING = "streaming" @@ -118,7 +116,7 @@ async def async_setup_entry( class TwitchSensor(SensorEntity): """Representation of a Twitch channel.""" - _attr_icon = ICON + _attr_translation_key = "channel" def __init__(self, channel: TwitchUser, client: Twitch) -> None: """Initialize the sensor."""