From 2050c97cf6a9a7693042bd19cc933bb2c2461c43 Mon Sep 17 00:00:00 2001 From: dougiteixeira <31328123+dougiteixeira@users.noreply.github.com> Date: Sun, 12 Nov 2023 17:52:04 -0300 Subject: [PATCH] Fix status paused --- custom_components/proxmoxve/sensor.py | 7 +++++++ custom_components/proxmoxve/strings.json | 8 ++++++++ custom_components/proxmoxve/translations/en.json | 8 ++++++++ custom_components/proxmoxve/translations/pt-BR.json | 8 ++++++++ 4 files changed, 31 insertions(+) diff --git a/custom_components/proxmoxve/sensor.py b/custom_components/proxmoxve/sensor.py index 99b9e32..abb2d02 100644 --- a/custom_components/proxmoxve/sensor.py +++ b/custom_components/proxmoxve/sensor.py @@ -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, diff --git a/custom_components/proxmoxve/strings.json b/custom_components/proxmoxve/strings.json index 2732961..11ca3d2 100644 --- a/custom_components/proxmoxve/strings.json +++ b/custom_components/proxmoxve/strings.json @@ -219,6 +219,14 @@ "node": { "name": "Node" }, + "status_raw": { + "name": "Status", + "state": { + "paused": "Paused", + "stopped": "Stopped", + "running": "Running" + } + }, "swap_free": { "name": "Swap free" }, diff --git a/custom_components/proxmoxve/translations/en.json b/custom_components/proxmoxve/translations/en.json index 8cf2f31..e6a472d 100644 --- a/custom_components/proxmoxve/translations/en.json +++ b/custom_components/proxmoxve/translations/en.json @@ -219,6 +219,14 @@ "node": { "name": "Node" }, + "status_raw": { + "name": "Status", + "state": { + "paused": "Paused", + "stopped": "Stopped", + "running": "Running" + } + }, "swap_free": { "name": "Swap free" }, diff --git a/custom_components/proxmoxve/translations/pt-BR.json b/custom_components/proxmoxve/translations/pt-BR.json index a725741..032e8f4 100644 --- a/custom_components/proxmoxve/translations/pt-BR.json +++ b/custom_components/proxmoxve/translations/pt-BR.json @@ -135,6 +135,14 @@ "node": { "name": "Nó" }, + "status_raw": { + "name": "Status", + "state": { + "paused": "Pausado", + "stopped": "Desligado", + "running": "Executando" + } + }, "swap_free": { "name": "Swap disponível" },