From a103a67a8cc98a9b8fd7e5007c0c0b673c15d470 Mon Sep 17 00:00:00 2001 From: Graham Ross Date: Sun, 20 Oct 2024 07:16:48 -0400 Subject: [PATCH] Added missing ReasonForResting string lookup --- code/Python/support/classic_modbusdecoder.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/Python/support/classic_modbusdecoder.py b/code/Python/support/classic_modbusdecoder.py index 9bdeed1..182e5da 100755 --- a/code/Python/support/classic_modbusdecoder.py +++ b/code/Python/support/classic_modbusdecoder.py @@ -303,10 +303,13 @@ def getModbusData(modeAwake, classicHost, classicPort): 34: "AD1CH.IbattMinus > 900 Peak negative battery current > 90.0 amps (Classic 150, 200)", 35: "Battery voltage is less than Low Battery Disconnect (LBD) Typically Vbatt is less than 8.5 volts", 104: "104?=14?: PV input is available but V is rising too slowly. Low Light or bad connection(Solar mode)", + 111: "Normal Power up boot." } try: - decoded["ReasonForRestingText"] = rest_reason_arr[decoded["ReasonForResting"]] + idx = decoded["ReasonForResting"] + decoded["ReasonForRestingText"] = rest_reason_arr[idx] except: - log.error("ReasonForRestingText Error ") + log.error("ReasonForRestingText Error index:{}".format(idx)) + decoded["ReasonForRestingText"] = "Unknown" return decoded