Fix Glances translation keys on CPU load, Memory use, Swap use (#111401)

Fix translation keys on CPU load, Memory use, Swap use
This commit is contained in:
wittypluck 2024-02-25 21:25:28 +01:00 committed by GitHub
parent 1c5be598f5
commit 716d8f8a00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 54 additions and 54 deletions

View File

@ -79,7 +79,7 @@ SENSOR_TYPES = {
("mem", "memory_use"): GlancesSensorEntityDescription(
key="memory_use",
type="mem",
translation_key="memory_used",
translation_key="memory_use",
native_unit_of_measurement=UnitOfInformation.MEBIBYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:memory",
@ -105,7 +105,7 @@ SENSOR_TYPES = {
("memswap", "swap_use"): GlancesSensorEntityDescription(
key="swap_use",
type="memswap",
translation_key="swap_used",
translation_key="swap_use",
native_unit_of_measurement=UnitOfInformation.GIBIBYTES,
device_class=SensorDeviceClass.DATA_SIZE,
icon="mdi:memory",

View File

@ -59,7 +59,7 @@
"swap_free": {
"name": "Swap free"
},
"cpu_load": {
"processor_load": {
"name": "CPU load"
},
"process_running": {

View File

@ -199,57 +199,6 @@
'state': '59',
})
# ---
# name: test_sensor_states[sensor.0_0_0_0_data_size-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.0_0_0_0_data_size',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <SensorDeviceClass.DATA_SIZE: 'data_size'>,
'original_icon': 'mdi:memory',
'original_name': 'Data size',
'platform': 'glances',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'memory_used',
'unique_id': 'test--memory_use',
'unit_of_measurement': <UnitOfInformation.MEBIBYTES: 'MiB'>,
})
# ---
# name: test_sensor_states[sensor.0_0_0_0_data_size-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': '0.0.0.0 Data size',
'icon': 'mdi:memory',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfInformation.MEBIBYTES: 'MiB'>,
}),
'context': <ANY>,
'entity_id': 'sensor.0_0_0_0_data_size',
'last_changed': <ANY>,
'last_updated': <ANY>,
'state': '1047.1',
})
# ---
# name: test_sensor_states[sensor.0_0_0_0_err_temp_temperature-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@ -749,6 +698,57 @@
'state': '27.6',
})
# ---
# name: test_sensor_states[sensor.0_0_0_0_memory_use-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.0_0_0_0_memory_use',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <SensorDeviceClass.DATA_SIZE: 'data_size'>,
'original_icon': 'mdi:memory',
'original_name': 'Memory use',
'platform': 'glances',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'memory_use',
'unique_id': 'test--memory_use',
'unit_of_measurement': <UnitOfInformation.MEBIBYTES: 'MiB'>,
})
# ---
# name: test_sensor_states[sensor.0_0_0_0_memory_use-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'data_size',
'friendly_name': '0.0.0.0 Memory use',
'icon': 'mdi:memory',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfInformation.MEBIBYTES: 'MiB'>,
}),
'context': <ANY>,
'entity_id': 'sensor.0_0_0_0_memory_use',
'last_changed': <ANY>,
'last_updated': <ANY>,
'state': '1047.1',
})
# ---
# name: test_sensor_states[sensor.0_0_0_0_na_temp_temperature-entry]
EntityRegistryEntrySnapshot({
'aliases': set({