From dfd8179a2d3577fa444640843fd6cd1dbc3d2a78 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Wed, 28 Feb 2024 08:50:16 +0100 Subject: [PATCH] Add icon translations to FiveM (#111539) --- homeassistant/components/fivem/const.py | 4 ---- homeassistant/components/fivem/icons.json | 15 +++++++++++++++ homeassistant/components/fivem/sensor.py | 6 ------ 3 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 homeassistant/components/fivem/icons.json diff --git a/homeassistant/components/fivem/const.py b/homeassistant/components/fivem/const.py index 1676dc9f2b3..28ce61981c6 100644 --- a/homeassistant/components/fivem/const.py +++ b/homeassistant/components/fivem/const.py @@ -5,10 +5,6 @@ ATTR_RESOURCES_LIST = "resources_list" DOMAIN = "fivem" -ICON_PLAYERS_MAX = "mdi:account-multiple" -ICON_PLAYERS_ONLINE = "mdi:account-multiple" -ICON_RESOURCES = "mdi:playlist-check" - MANUFACTURER = "Cfx.re" NAME_PLAYERS_MAX = "Players Max" diff --git a/homeassistant/components/fivem/icons.json b/homeassistant/components/fivem/icons.json new file mode 100644 index 00000000000..d5d019348d9 --- /dev/null +++ b/homeassistant/components/fivem/icons.json @@ -0,0 +1,15 @@ +{ + "entity": { + "sensor": { + "max_players": { + "default": "mdi:account-multiple" + }, + "online_players": { + "default": "mdi:account-multiple" + }, + "resources": { + "default": "mdi:playlist-check" + } + } + } +} diff --git a/homeassistant/components/fivem/sensor.py b/homeassistant/components/fivem/sensor.py index 967a1392fe5..c39f67c5503 100644 --- a/homeassistant/components/fivem/sensor.py +++ b/homeassistant/components/fivem/sensor.py @@ -11,9 +11,6 @@ from .const import ( ATTR_PLAYERS_LIST, ATTR_RESOURCES_LIST, DOMAIN, - ICON_PLAYERS_MAX, - ICON_PLAYERS_ONLINE, - ICON_RESOURCES, NAME_PLAYERS_MAX, NAME_PLAYERS_ONLINE, NAME_RESOURCES, @@ -33,20 +30,17 @@ SENSORS: tuple[FiveMSensorEntityDescription, ...] = ( FiveMSensorEntityDescription( key=NAME_PLAYERS_MAX, translation_key="max_players", - icon=ICON_PLAYERS_MAX, native_unit_of_measurement=UNIT_PLAYERS_MAX, ), FiveMSensorEntityDescription( key=NAME_PLAYERS_ONLINE, translation_key="online_players", - icon=ICON_PLAYERS_ONLINE, native_unit_of_measurement=UNIT_PLAYERS_ONLINE, extra_attrs=[ATTR_PLAYERS_LIST], ), FiveMSensorEntityDescription( key=NAME_RESOURCES, translation_key="resources", - icon=ICON_RESOURCES, native_unit_of_measurement=UNIT_RESOURCES, extra_attrs=[ATTR_RESOURCES_LIST], ),