mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Split Owncloud CPU load in separate sensors (#99141)
* split cpu load values into own sensors * apply suggestion
This commit is contained in:
parent
d17ffff3e3
commit
cc103ddbaa
@ -54,6 +54,11 @@ class NextcloudDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
|
|||||||
key_path += f"{key}_"
|
key_path += f"{key}_"
|
||||||
leaf = True
|
leaf = True
|
||||||
result.update(self._get_data_points(value, key_path, leaf))
|
result.update(self._get_data_points(value, key_path, leaf))
|
||||||
|
elif key == "cpuload" and isinstance(value, list):
|
||||||
|
result[f"{key_path}{key}_1"] = value[0]
|
||||||
|
result[f"{key_path}{key}_5"] = value[1]
|
||||||
|
result[f"{key_path}{key}_15"] = value[2]
|
||||||
|
leaf = False
|
||||||
else:
|
else:
|
||||||
result[f"{key_path}{key}"] = value
|
result[f"{key_path}{key}"] = value
|
||||||
leaf = False
|
leaf = False
|
||||||
|
@ -171,10 +171,26 @@ SENSORS: Final[dict[str, SensorEntityDescription]] = {
|
|||||||
translation_key="nextcloud_system_apps_num_updates_available",
|
translation_key="nextcloud_system_apps_num_updates_available",
|
||||||
icon="mdi:update",
|
icon="mdi:update",
|
||||||
),
|
),
|
||||||
"system_cpuload": SensorEntityDescription(
|
"system_cpuload_1": SensorEntityDescription(
|
||||||
key="system_cpuload",
|
key="system_cpuload_1",
|
||||||
translation_key="nextcloud_system_cpuload",
|
translation_key="nextcloud_system_cpuload_1",
|
||||||
|
native_unit_of_measurement=UNIT_OF_LOAD,
|
||||||
icon="mdi:chip",
|
icon="mdi:chip",
|
||||||
|
suggested_display_precision=2,
|
||||||
|
),
|
||||||
|
"system_cpuload_5": SensorEntityDescription(
|
||||||
|
key="system_cpuload_5",
|
||||||
|
translation_key="nextcloud_system_cpuload_5",
|
||||||
|
native_unit_of_measurement=UNIT_OF_LOAD,
|
||||||
|
icon="mdi:chip",
|
||||||
|
suggested_display_precision=2,
|
||||||
|
),
|
||||||
|
"system_cpuload_15": SensorEntityDescription(
|
||||||
|
key="system_cpuload_15",
|
||||||
|
translation_key="nextcloud_system_cpuload_15",
|
||||||
|
native_unit_of_measurement=UNIT_OF_LOAD,
|
||||||
|
icon="mdi:chip",
|
||||||
|
suggested_display_precision=2,
|
||||||
),
|
),
|
||||||
"system_freespace": SensorEntityDescription(
|
"system_freespace": SensorEntityDescription(
|
||||||
key="system_freespace",
|
key="system_freespace",
|
||||||
|
@ -63,8 +63,14 @@
|
|||||||
"nextcloud_system_freespace": {
|
"nextcloud_system_freespace": {
|
||||||
"name": "Free space"
|
"name": "Free space"
|
||||||
},
|
},
|
||||||
"nextcloud_system_cpuload": {
|
"nextcloud_system_cpuload_1": {
|
||||||
"name": "CPU Load"
|
"name": "CPU Load last minute"
|
||||||
|
},
|
||||||
|
"nextcloud_system_cpuload_15": {
|
||||||
|
"name": "CPU Load last 15 minutes"
|
||||||
|
},
|
||||||
|
"nextcloud_system_cpuload_5": {
|
||||||
|
"name": "CPU Load last 5 minutes"
|
||||||
},
|
},
|
||||||
"nextcloud_system_mem_total": {
|
"nextcloud_system_mem_total": {
|
||||||
"name": "Total memory"
|
"name": "Total memory"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user