Skip to content

Commit

Permalink
Fix Memory Free Percentage VMs
Browse files Browse the repository at this point in the history
  • Loading branch information
dougiteixeira committed Mar 12, 2023
1 parent 46abc06 commit f1c32ec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions custom_components/proxmoxve/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ class ProxmoxSensorEntityDescription(ProxmoxEntityDescription, SensorEntityDescr
icon="mdi:memory",
native_unit_of_measurement=PERCENTAGE,
conversion_fn=lambda x: round(x * 100, 1),
value_fn=lambda x: 1
- x[ProxmoxKeyAPIParse.MEMORY_FREE] / x[ProxmoxKeyAPIParse.MEMORY_TOTAL] if x[ProxmoxKeyAPIParse.MEMORY_TOTAL] > 0 else 0,
value_fn=lambda x: x[ProxmoxKeyAPIParse.MEMORY_FREE] / x[ProxmoxKeyAPIParse.MEMORY_TOTAL] if x[ProxmoxKeyAPIParse.MEMORY_TOTAL] > 0 else 0,
state_class=SensorStateClass.MEASUREMENT,
),
ProxmoxSensorEntityDescription(
Expand Down

0 comments on commit f1c32ec

Please sign in to comment.