From a03bf907632edebfb832b1111963e1698099b60c Mon Sep 17 00:00:00 2001 From: dougiteixeira <31328123+dougiteixeira@users.noreply.github.com> Date: Sun, 26 Mar 2023 19:14:47 -0300 Subject: [PATCH] Fix the order of the sensors --- custom_components/proxmoxve/sensor.py | 46 +++++++++++++-------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/custom_components/proxmoxve/sensor.py b/custom_components/proxmoxve/sensor.py index 06cc19e..1081ff8 100644 --- a/custom_components/proxmoxve/sensor.py +++ b/custom_components/proxmoxve/sensor.py @@ -170,7 +170,6 @@ class ProxmoxSensorEntityDescription(ProxmoxEntityDescription, SensorEntityDescr state_class=SensorStateClass.MEASUREMENT, suggested_display_precision=2, suggested_unit_of_measurement=UnitOfInformation.GIGABYTES, - entity_registry_enabled_default=False, ), ProxmoxSensorEntityDescription( key="swap_free_perc", @@ -280,28 +279,6 @@ class ProxmoxSensorEntityDescription(ProxmoxEntityDescription, SensorEntityDescr state_class=SensorStateClass.MEASUREMENT, suggested_display_precision=1, ), - ProxmoxSensorEntityDescription( - key=ProxmoxKeyAPIParse.NETWORK_IN, - name="Network in", - icon="mdi:download-network-outline", - native_unit_of_measurement=UnitOfInformation.BYTES, - device_class=SensorDeviceClass.DATA_SIZE, - state_class=SensorStateClass.MEASUREMENT, - suggested_display_precision=2, - suggested_unit_of_measurement=UnitOfInformation.MEGABYTES, - entity_registry_enabled_default=False, - ), - ProxmoxSensorEntityDescription( - key=ProxmoxKeyAPIParse.NETWORK_OUT, - name="Network out", - icon="mdi:upload-network-outline", - native_unit_of_measurement=UnitOfInformation.BYTES, - device_class=SensorDeviceClass.DATA_SIZE, - state_class=SensorStateClass.MEASUREMENT, - suggested_display_precision=2, - suggested_unit_of_measurement=UnitOfInformation.MEGABYTES, - entity_registry_enabled_default=False, - ), ProxmoxSensorEntityDescription( key=ProxmoxKeyAPIParse.MEMORY_FREE, name="Memory free", @@ -324,6 +301,7 @@ class ProxmoxSensorEntityDescription(ProxmoxEntityDescription, SensorEntityDescr else 0, state_class=SensorStateClass.MEASUREMENT, suggested_display_precision=1, + entity_registry_enabled_default=False, ), ProxmoxSensorEntityDescription( key=ProxmoxKeyAPIParse.MEMORY_TOTAL, @@ -359,6 +337,28 @@ class ProxmoxSensorEntityDescription(ProxmoxEntityDescription, SensorEntityDescr state_class=SensorStateClass.MEASUREMENT, suggested_display_precision=1, ), + ProxmoxSensorEntityDescription( + key=ProxmoxKeyAPIParse.NETWORK_IN, + name="Network in", + icon="mdi:download-network-outline", + native_unit_of_measurement=UnitOfInformation.BYTES, + device_class=SensorDeviceClass.DATA_SIZE, + state_class=SensorStateClass.MEASUREMENT, + suggested_display_precision=2, + suggested_unit_of_measurement=UnitOfInformation.MEGABYTES, + entity_registry_enabled_default=False, + ), + ProxmoxSensorEntityDescription( + key=ProxmoxKeyAPIParse.NETWORK_OUT, + name="Network out", + icon="mdi:upload-network-outline", + native_unit_of_measurement=UnitOfInformation.BYTES, + device_class=SensorDeviceClass.DATA_SIZE, + state_class=SensorStateClass.MEASUREMENT, + suggested_display_precision=2, + suggested_unit_of_measurement=UnitOfInformation.MEGABYTES, + entity_registry_enabled_default=False, + ), ProxmoxSensorEntityDescription( key=ProxmoxKeyAPIParse.UPTIME, name="Uptime",