Skip to content

Commit

Permalink
Fix status paused
Browse files Browse the repository at this point in the history
  • Loading branch information
dougiteixeira committed Nov 12, 2023
1 parent f19e764 commit 2050c97
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions custom_components/proxmoxve/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,13 @@ class ProxmoxSensorEntityDescription(ProxmoxEntityDescription, SensorEntityDescr
icon="mdi:server",
translation_key="node",
),
ProxmoxSensorEntityDescription(
key="status_raw",
name="Status",
icon="mdi:server",
translation_key="status_raw",
value_fn=lambda x: "paused" if x.health == "paused" else x.status,
),
*PROXMOX_SENSOR_CPU,
*PROXMOX_SENSOR_DISK,
*PROXMOX_SENSOR_MEMORY,
Expand Down
8 changes: 8 additions & 0 deletions custom_components/proxmoxve/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,14 @@
"node": {
"name": "Node"
},
"status_raw": {
"name": "Status",
"state": {
"paused": "Paused",
"stopped": "Stopped",
"running": "Running"
}
},
"swap_free": {
"name": "Swap free"
},
Expand Down
8 changes: 8 additions & 0 deletions custom_components/proxmoxve/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,14 @@
"node": {
"name": "Node"
},
"status_raw": {
"name": "Status",
"state": {
"paused": "Paused",
"stopped": "Stopped",
"running": "Running"
}
},
"swap_free": {
"name": "Swap free"
},
Expand Down
8 changes: 8 additions & 0 deletions custom_components/proxmoxve/translations/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@
"node": {
"name": ""
},
"status_raw": {
"name": "Status",
"state": {
"paused": "Pausado",
"stopped": "Desligado",
"running": "Executando"
}
},
"swap_free": {
"name": "Swap disponível"
},
Expand Down

0 comments on commit 2050c97

Please sign in to comment.