Add icon translations to Systemmonitor (#112300)

* Add icon translations to Systemmonitor

* Add icon translations to Systemmonitor
This commit is contained in:
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

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