Add icon translations to Systemmonitor (#112300)

* Add icon translations to Systemmonitor

* Add icon translations to Systemmonitor
pull/112372/head
Joost Lekkerkerker 2024-03-05 11:52:50 +01:00 committed by GitHub
parent 33c1e7d45d
commit 0b4fafddbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 51 additions and 41 deletions

View File

@ -0,0 +1,51 @@
{
"entity": {
"sensor": {
"disk_free": {
"default": "mdi:harddisk"
},
"disk_use": {
"default": "mdi:harddisk"
},
"disk_use_percent": {
"default": "mdi:harddisk"
},
"ipv4_address": {
"default": "mdi:ip-network"
},
"ipv6_address": {
"default": "mdi:ip-network"
},
"memory_free": {
"default": "mdi:memory"
},
"memory_use": {
"default": "mdi:memory"
},
"memory_use_percent": {
"default": "mdi:memory"
},
"network_in": {
"default": "mdi:server-network"
},
"network_out": {
"default": "mdi:server-network"
},
"packets_in": {
"default": "mdi:server-network"
},
"packets_out": {
"default": "mdi:server-network"
},
"swap_free": {
"default": "mdi:harddisk"
},
"swap_use": {
"default": "mdi:harddisk"
},
"swap_use_percent": {
"default": "mdi:harddisk"
}
}
}
}

View File

@ -164,7 +164,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
placeholder="mount_point",
native_unit_of_measurement=UnitOfInformation.GIBIBYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:harddisk",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda entity: round(
entity.coordinator.data.disk_usage[entity.argument].free / 1024**3, 1
@ -180,7 +179,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
placeholder="mount_point",
native_unit_of_measurement=UnitOfInformation.GIBIBYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:harddisk",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda entity: round(
entity.coordinator.data.disk_usage[entity.argument].used / 1024**3, 1
@ -195,7 +193,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
translation_key="disk_use_percent",
placeholder="mount_point",
native_unit_of_measurement=PERCENTAGE,
icon="mdi:harddisk",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda entity: entity.coordinator.data.disk_usage[
entity.argument
@ -209,7 +206,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
key="ipv4_address",
translation_key="ipv4_address",
placeholder="ip_address",
icon="mdi:ip-network",
mandatory_arg=True,
value_fn=get_ip_address,
add_to_update=lambda entity: ("addresses", ""),
@ -218,7 +214,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
key="ipv6_address",
translation_key="ipv6_address",
placeholder="ip_address",
icon="mdi:ip-network",
mandatory_arg=True,
value_fn=get_ip_address,
add_to_update=lambda entity: ("addresses", ""),
@ -259,7 +254,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
translation_key="memory_free",
native_unit_of_measurement=UnitOfInformation.MEBIBYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:memory",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda entity: round(
entity.coordinator.data.memory.available / 1024**2, 1
@ -271,7 +265,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
translation_key="memory_use",
native_unit_of_measurement=UnitOfInformation.MEBIBYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:memory",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda entity: round(
(
@ -287,7 +280,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
key="memory_use_percent",
translation_key="memory_use_percent",
native_unit_of_measurement=PERCENTAGE,
icon="mdi:memory",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda entity: entity.coordinator.data.memory.percent,
add_to_update=lambda entity: ("memory", ""),
@ -298,7 +290,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
placeholder="interface",
native_unit_of_measurement=UnitOfInformation.MEBIBYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:server-network",
state_class=SensorStateClass.TOTAL_INCREASING,
mandatory_arg=True,
value_fn=get_network,
@ -310,7 +301,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
placeholder="interface",
native_unit_of_measurement=UnitOfInformation.MEBIBYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:server-network",
state_class=SensorStateClass.TOTAL_INCREASING,
mandatory_arg=True,
value_fn=get_network,
@ -320,7 +310,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
key="packets_in",
translation_key="packets_in",
placeholder="interface",
icon="mdi:server-network",
state_class=SensorStateClass.TOTAL_INCREASING,
mandatory_arg=True,
value_fn=get_packets,
@ -330,7 +319,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
key="packets_out",
translation_key="packets_out",
placeholder="interface",
icon="mdi:server-network",
state_class=SensorStateClass.TOTAL_INCREASING,
mandatory_arg=True,
value_fn=get_packets,
@ -395,7 +383,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
translation_key="swap_free",
native_unit_of_measurement=UnitOfInformation.MEBIBYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:harddisk",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda entity: round(entity.coordinator.data.swap.free / 1024**2, 1),
add_to_update=lambda entity: ("swap", ""),
@ -405,7 +392,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
translation_key="swap_use",
native_unit_of_measurement=UnitOfInformation.MEBIBYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:harddisk",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda entity: round(entity.coordinator.data.swap.used / 1024**2, 1),
add_to_update=lambda entity: ("swap", ""),
@ -414,7 +400,6 @@ SENSOR_TYPES: dict[str, SysMonitorSensorEntityDescription] = {
key="swap_use_percent",
translation_key="swap_use_percent",
native_unit_of_measurement=PERCENTAGE,
icon="mdi:harddisk",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda entity: entity.coordinator.data.swap.percent,
add_to_update=lambda entity: ("swap", ""),

View File

@ -3,7 +3,6 @@
ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': 'System Monitor Disk free /',
'icon': 'mdi:harddisk',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfInformation.GIBIBYTES: 'GiB'>,
})
@ -15,7 +14,6 @@
ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': 'System Monitor Disk free /media/share',
'icon': 'mdi:harddisk',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfInformation.GIBIBYTES: 'GiB'>,
})
@ -26,7 +24,6 @@
# name: test_sensor[System Monitor Disk usage / - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor Disk usage /',
'icon': 'mdi:harddisk',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': '%',
})
@ -37,7 +34,6 @@
# name: test_sensor[System Monitor Disk usage /home/notexist/ - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor Disk usage /home/notexist/',
'icon': 'mdi:harddisk',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': '%',
})
@ -48,7 +44,6 @@
# name: test_sensor[System Monitor Disk usage /media/share - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor Disk usage /media/share',
'icon': 'mdi:harddisk',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': '%',
})
@ -60,7 +55,6 @@
ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': 'System Monitor Disk use /',
'icon': 'mdi:harddisk',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfInformation.GIBIBYTES: 'GiB'>,
})
@ -72,7 +66,6 @@
ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': 'System Monitor Disk use /media/share',
'icon': 'mdi:harddisk',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfInformation.GIBIBYTES: 'GiB'>,
})
@ -83,7 +76,6 @@
# name: test_sensor[System Monitor IPv4 address eth0 - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor IPv4 address eth0',
'icon': 'mdi:ip-network',
})
# ---
# name: test_sensor[System Monitor IPv4 address eth0 - state]
@ -92,7 +84,6 @@
# name: test_sensor[System Monitor IPv4 address eth1 - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor IPv4 address eth1',
'icon': 'mdi:ip-network',
})
# ---
# name: test_sensor[System Monitor IPv4 address eth1 - state]
@ -101,7 +92,6 @@
# name: test_sensor[System Monitor IPv6 address eth0 - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor IPv6 address eth0',
'icon': 'mdi:ip-network',
})
# ---
# name: test_sensor[System Monitor IPv6 address eth0 - state]
@ -110,7 +100,6 @@
# name: test_sensor[System Monitor IPv6 address eth1 - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor IPv6 address eth1',
'icon': 'mdi:ip-network',
})
# ---
# name: test_sensor[System Monitor IPv6 address eth1 - state]
@ -159,7 +148,6 @@
ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': 'System Monitor Memory free',
'icon': 'mdi:memory',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfInformation.MEBIBYTES: 'MiB'>,
})
@ -170,7 +158,6 @@
# name: test_sensor[System Monitor Memory usage - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor Memory usage',
'icon': 'mdi:memory',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': '%',
})
@ -182,7 +169,6 @@
ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': 'System Monitor Memory use',
'icon': 'mdi:memory',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfInformation.MEBIBYTES: 'MiB'>,
})
@ -194,7 +180,6 @@
ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': 'System Monitor Network in eth0',
'icon': 'mdi:server-network',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': <UnitOfInformation.MEBIBYTES: 'MiB'>,
})
@ -206,7 +191,6 @@
ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': 'System Monitor Network in eth1',
'icon': 'mdi:server-network',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': <UnitOfInformation.MEBIBYTES: 'MiB'>,
})
@ -218,7 +202,6 @@
ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': 'System Monitor Network out eth0',
'icon': 'mdi:server-network',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': <UnitOfInformation.MEBIBYTES: 'MiB'>,
})
@ -230,7 +213,6 @@
ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': 'System Monitor Network out eth1',
'icon': 'mdi:server-network',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': <UnitOfInformation.MEBIBYTES: 'MiB'>,
})
@ -285,7 +267,6 @@
# name: test_sensor[System Monitor Packets in eth0 - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor Packets in eth0',
'icon': 'mdi:server-network',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
})
# ---
@ -295,7 +276,6 @@
# name: test_sensor[System Monitor Packets in eth1 - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor Packets in eth1',
'icon': 'mdi:server-network',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
})
# ---
@ -305,7 +285,6 @@
# name: test_sensor[System Monitor Packets out eth0 - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor Packets out eth0',
'icon': 'mdi:server-network',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
})
# ---
@ -315,7 +294,6 @@
# name: test_sensor[System Monitor Packets out eth1 - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor Packets out eth1',
'icon': 'mdi:server-network',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
})
# ---
@ -366,7 +344,6 @@
ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': 'System Monitor Swap free',
'icon': 'mdi:harddisk',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfInformation.MEBIBYTES: 'MiB'>,
})
@ -377,7 +354,6 @@
# name: test_sensor[System Monitor Swap usage - attributes]
ReadOnlyDict({
'friendly_name': 'System Monitor Swap usage',
'icon': 'mdi:harddisk',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': '%',
})
@ -389,7 +365,6 @@
ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': 'System Monitor Swap use',
'icon': 'mdi:harddisk',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfInformation.MEBIBYTES: 'MiB'>,
})

View File

@ -60,7 +60,6 @@ async def test_sensor(
"state_class": "measurement",
"unit_of_measurement": "MiB",
"device_class": "data_size",
"icon": "mdi:memory",
"friendly_name": "System Monitor Memory free",
}