Add icon translations to Minecraft Server (#111928)
* Add icon translations to Minecraft Server * Add icon translations to Minecraft Server * Add icon translations to Minecraftpull/111954/head
parent
59d605c82c
commit
1f3b0a4371
|
@ -14,8 +14,6 @@ from .const import DOMAIN
|
|||
from .coordinator import MinecraftServerCoordinator
|
||||
from .entity import MinecraftServerEntity
|
||||
|
||||
ICON_STATUS = "mdi:lan"
|
||||
|
||||
KEY_STATUS = "status"
|
||||
|
||||
|
||||
|
@ -29,7 +27,6 @@ BINARY_SENSOR_DESCRIPTIONS = [
|
|||
key=KEY_STATUS,
|
||||
translation_key=KEY_STATUS,
|
||||
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
||||
icon=ICON_STATUS,
|
||||
),
|
||||
]
|
||||
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"entity": {
|
||||
"binary_sensor": {
|
||||
"status": {
|
||||
"default": "mdi:lan",
|
||||
"state": {
|
||||
"on": "mdi:lan-connect",
|
||||
"off": "mdi:lan-disconnect"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"edition": {
|
||||
"default": "mdi:minecraft"
|
||||
},
|
||||
"game_mode": {
|
||||
"default": "mdi:cog"
|
||||
},
|
||||
"latency": {
|
||||
"default": "mdi:signal"
|
||||
},
|
||||
"players_max": {
|
||||
"default": "mdi:account-multiple"
|
||||
},
|
||||
"players_online": {
|
||||
"default": "mdi:account-multiple"
|
||||
},
|
||||
"protocol_version": {
|
||||
"default": "mdi:numeric"
|
||||
},
|
||||
"version": {
|
||||
"default": "mdi:numeric"
|
||||
},
|
||||
"motd": {
|
||||
"default": "mdi:minecraft"
|
||||
},
|
||||
"map_name": {
|
||||
"default": "mdi:map"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -19,16 +19,6 @@ from .entity import MinecraftServerEntity
|
|||
|
||||
ATTR_PLAYERS_LIST = "players_list"
|
||||
|
||||
ICON_EDITION = "mdi:minecraft"
|
||||
ICON_GAME_MODE = "mdi:cog"
|
||||
ICON_MAP_NAME = "mdi:map"
|
||||
ICON_LATENCY = "mdi:signal"
|
||||
ICON_PLAYERS_MAX = "mdi:account-multiple"
|
||||
ICON_PLAYERS_ONLINE = "mdi:account-multiple"
|
||||
ICON_PROTOCOL_VERSION = "mdi:numeric"
|
||||
ICON_VERSION = "mdi:numeric"
|
||||
ICON_MOTD = "mdi:minecraft"
|
||||
|
||||
KEY_EDITION = "edition"
|
||||
KEY_GAME_MODE = "game_mode"
|
||||
KEY_MAP_NAME = "map_name"
|
||||
|
@ -74,7 +64,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
MinecraftServerSensorEntityDescription(
|
||||
key=KEY_VERSION,
|
||||
translation_key=KEY_VERSION,
|
||||
icon=ICON_VERSION,
|
||||
value_fn=lambda data: data.version,
|
||||
attributes_fn=None,
|
||||
supported_server_types={
|
||||
|
@ -86,7 +75,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
MinecraftServerSensorEntityDescription(
|
||||
key=KEY_PROTOCOL_VERSION,
|
||||
translation_key=KEY_PROTOCOL_VERSION,
|
||||
icon=ICON_PROTOCOL_VERSION,
|
||||
value_fn=lambda data: data.protocol_version,
|
||||
attributes_fn=None,
|
||||
supported_server_types={
|
||||
|
@ -100,7 +88,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
key=KEY_PLAYERS_MAX,
|
||||
translation_key=KEY_PLAYERS_MAX,
|
||||
native_unit_of_measurement=UNIT_PLAYERS_MAX,
|
||||
icon=ICON_PLAYERS_MAX,
|
||||
value_fn=lambda data: data.players_max,
|
||||
attributes_fn=None,
|
||||
supported_server_types={
|
||||
|
@ -114,7 +101,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
translation_key=KEY_LATENCY,
|
||||
native_unit_of_measurement=UnitOfTime.MILLISECONDS,
|
||||
suggested_display_precision=0,
|
||||
icon=ICON_LATENCY,
|
||||
value_fn=lambda data: data.latency,
|
||||
attributes_fn=None,
|
||||
supported_server_types={
|
||||
|
@ -126,7 +112,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
MinecraftServerSensorEntityDescription(
|
||||
key=KEY_MOTD,
|
||||
translation_key=KEY_MOTD,
|
||||
icon=ICON_MOTD,
|
||||
value_fn=lambda data: data.motd,
|
||||
attributes_fn=None,
|
||||
supported_server_types={
|
||||
|
@ -138,7 +123,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
key=KEY_PLAYERS_ONLINE,
|
||||
translation_key=KEY_PLAYERS_ONLINE,
|
||||
native_unit_of_measurement=UNIT_PLAYERS_ONLINE,
|
||||
icon=ICON_PLAYERS_ONLINE,
|
||||
value_fn=lambda data: data.players_online,
|
||||
attributes_fn=get_extra_state_attributes_players_list,
|
||||
supported_server_types={
|
||||
|
@ -149,7 +133,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
MinecraftServerSensorEntityDescription(
|
||||
key=KEY_EDITION,
|
||||
translation_key=KEY_EDITION,
|
||||
icon=ICON_EDITION,
|
||||
value_fn=lambda data: data.edition,
|
||||
attributes_fn=None,
|
||||
supported_server_types={
|
||||
|
@ -161,7 +144,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
MinecraftServerSensorEntityDescription(
|
||||
key=KEY_GAME_MODE,
|
||||
translation_key=KEY_GAME_MODE,
|
||||
icon=ICON_GAME_MODE,
|
||||
value_fn=lambda data: data.game_mode,
|
||||
attributes_fn=None,
|
||||
supported_server_types={
|
||||
|
@ -171,7 +153,6 @@ SENSOR_DESCRIPTIONS = [
|
|||
MinecraftServerSensorEntityDescription(
|
||||
key=KEY_MAP_NAME,
|
||||
translation_key=KEY_MAP_NAME,
|
||||
icon=ICON_MAP_NAME,
|
||||
value_fn=lambda data: data.map_name,
|
||||
attributes_fn=None,
|
||||
supported_server_types={
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'connectivity',
|
||||
'friendly_name': 'Minecraft Server Status',
|
||||
'icon': 'mdi:lan',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.minecraft_server_status',
|
||||
|
@ -18,7 +17,6 @@
|
|||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'connectivity',
|
||||
'friendly_name': 'Minecraft Server Status',
|
||||
'icon': 'mdi:lan',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.minecraft_server_status',
|
||||
|
@ -32,7 +30,6 @@
|
|||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'connectivity',
|
||||
'friendly_name': 'Minecraft Server Status',
|
||||
'icon': 'mdi:lan',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.minecraft_server_status',
|
||||
|
@ -46,7 +43,6 @@
|
|||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'connectivity',
|
||||
'friendly_name': 'Minecraft Server Status',
|
||||
'icon': 'mdi:lan',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'binary_sensor.minecraft_server_status',
|
||||
|
@ -54,4 +50,4 @@
|
|||
'last_updated': <ANY>,
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# ---
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Latency',
|
||||
'icon': 'mdi:signal',
|
||||
'unit_of_measurement': <UnitOfTime.MILLISECONDS: 'ms'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
@ -17,7 +16,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Players online',
|
||||
'icon': 'mdi:account-multiple',
|
||||
'unit_of_measurement': 'players',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
@ -31,7 +29,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Players max',
|
||||
'icon': 'mdi:account-multiple',
|
||||
'unit_of_measurement': 'players',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
@ -45,7 +42,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server World message',
|
||||
'icon': 'mdi:minecraft',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_world_message',
|
||||
|
@ -58,7 +54,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Version',
|
||||
'icon': 'mdi:numeric',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_version',
|
||||
|
@ -71,7 +66,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Protocol version',
|
||||
'icon': 'mdi:numeric',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_protocol_version',
|
||||
|
@ -84,7 +78,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Map name',
|
||||
'icon': 'mdi:map',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_map_name',
|
||||
|
@ -97,7 +90,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Game mode',
|
||||
'icon': 'mdi:cog',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_game_mode',
|
||||
|
@ -110,7 +102,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Edition',
|
||||
'icon': 'mdi:minecraft',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_edition',
|
||||
|
@ -123,7 +114,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Latency',
|
||||
'icon': 'mdi:signal',
|
||||
'unit_of_measurement': <UnitOfTime.MILLISECONDS: 'ms'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
@ -137,7 +127,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Players online',
|
||||
'icon': 'mdi:account-multiple',
|
||||
'players_list': list([
|
||||
'Player 1',
|
||||
'Player 2',
|
||||
|
@ -156,7 +145,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Players max',
|
||||
'icon': 'mdi:account-multiple',
|
||||
'unit_of_measurement': 'players',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
@ -170,7 +158,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server World message',
|
||||
'icon': 'mdi:minecraft',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_world_message',
|
||||
|
@ -183,7 +170,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Version',
|
||||
'icon': 'mdi:numeric',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_version',
|
||||
|
@ -196,7 +182,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Protocol version',
|
||||
'icon': 'mdi:numeric',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_protocol_version',
|
||||
|
@ -209,7 +194,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Latency',
|
||||
'icon': 'mdi:signal',
|
||||
'unit_of_measurement': <UnitOfTime.MILLISECONDS: 'ms'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
@ -223,7 +207,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Players online',
|
||||
'icon': 'mdi:account-multiple',
|
||||
'unit_of_measurement': 'players',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
@ -237,7 +220,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Players max',
|
||||
'icon': 'mdi:account-multiple',
|
||||
'unit_of_measurement': 'players',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
@ -251,7 +233,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server World message',
|
||||
'icon': 'mdi:minecraft',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_world_message',
|
||||
|
@ -264,7 +245,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Version',
|
||||
'icon': 'mdi:numeric',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_version',
|
||||
|
@ -277,7 +257,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Protocol version',
|
||||
'icon': 'mdi:numeric',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_protocol_version',
|
||||
|
@ -290,7 +269,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Map name',
|
||||
'icon': 'mdi:map',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_map_name',
|
||||
|
@ -303,7 +281,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Game mode',
|
||||
'icon': 'mdi:cog',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_game_mode',
|
||||
|
@ -316,7 +293,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Edition',
|
||||
'icon': 'mdi:minecraft',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_edition',
|
||||
|
@ -329,7 +305,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Latency',
|
||||
'icon': 'mdi:signal',
|
||||
'unit_of_measurement': <UnitOfTime.MILLISECONDS: 'ms'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
@ -343,7 +318,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Players online',
|
||||
'icon': 'mdi:account-multiple',
|
||||
'players_list': list([
|
||||
'Player 1',
|
||||
'Player 2',
|
||||
|
@ -362,7 +336,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Players max',
|
||||
'icon': 'mdi:account-multiple',
|
||||
'unit_of_measurement': 'players',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
|
@ -376,7 +349,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server World message',
|
||||
'icon': 'mdi:minecraft',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_world_message',
|
||||
|
@ -389,7 +361,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Version',
|
||||
'icon': 'mdi:numeric',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_version',
|
||||
|
@ -402,7 +373,6 @@
|
|||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Minecraft Server Protocol version',
|
||||
'icon': 'mdi:numeric',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.minecraft_server_protocol_version',
|
||||
|
|
Loading…
Reference in New Issue