From ffa8e245ba2fa024f4e35316a6e0cd5d6f91fdd0 Mon Sep 17 00:00:00 2001 From: Scott Lowe Date: Fri, 4 Sep 2020 10:32:40 +0200 Subject: [PATCH] Modify undervoltage status display in device command Change-type: patch Signed-off-by: Scott Lowe --- lib/actions-oclif/device/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/actions-oclif/device/index.ts b/lib/actions-oclif/device/index.ts index ef52b2a2..7795f4d8 100644 --- a/lib/actions-oclif/device/index.ts +++ b/lib/actions-oclif/device/index.ts @@ -130,7 +130,12 @@ export default class DeviceCmd extends Command { device.cpu_temp_c = device.cpu_temp; device.cpu_usage_percent = device.cpu_usage; - device.undervoltage_detected = device.is_undervolted; + + // Only show undervoltage status if true + // API sends false even for devices which are not detecting this. + if (device.is_undervolted) { + device.undervoltage_detected = device.is_undervolted; + } if ( device.memory_usage != null &&