Add icon translations to FiveM (#111539)

This commit is contained in:
Joost Lekkerkerker 2024-02-28 08:50:16 +01:00 committed by GitHub
parent cd9219d4c6
commit dfd8179a2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 15 additions and 10 deletions

View file

@ -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"

View file

@ -0,0 +1,15 @@
{
"entity": {
"sensor": {
"max_players": {
"default": "mdi:account-multiple"
},
"online_players": {
"default": "mdi:account-multiple"
},
"resources": {
"default": "mdi:playlist-check"
}
}
}
}

View file

@ -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],
),