Skip to content

Commit

Permalink
Merge pull request #65 from dougiteixeira/sensor-order-fix
Browse files Browse the repository at this point in the history
Fix the order of the sensors
  • Loading branch information
dougiteixeira authored Mar 26, 2023
2 parents 427084e + a03bf90 commit 070c9f2
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions custom_components/proxmoxve/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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,
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 070c9f2

Please sign in to comment.