From 0ad2154faa491a8607d44b852930a0a0f49b8651 Mon Sep 17 00:00:00 2001 From: DaRK AnGeL <28630321+masterwishx@users.noreply.github.com> Date: Mon, 21 Oct 2024 12:40:47 +0300 Subject: [PATCH] change back to ABM_UNKNOWN and use only BOOL chrg/dschrg (eaton_charging_info(),eaton_discharging_info()) func to make same as was in original code for Constant Charge Signed-off-by: DaRK AnGeL <28630321+masterwishx@users.noreply.github.com> --- drivers/mge-hid.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mge-hid.c b/drivers/mge-hid.c index 2c967774d1..e3ac0bdf92 100644 --- a/drivers/mge-hid.c +++ b/drivers/mge-hid.c @@ -277,11 +277,11 @@ static const char *eaton_abm_enabled_type_fun(double value) if ((advanced_battery_monitoring != ABM_ENABLED_TYPE) && (advanced_battery_mode != ABM_CHARGER_MODE)) { - /* NOTE: ABM_DISABLED or ABM_UNKNOWN - when no ABM only Constant Charge (CC)? - * ABM_DISABLED - then no battery.charger.status will be avalible + /* NOTE: ABM_DISABLED or ABM_UNKNOWN - when no ABM only Constant Charge (CC) when ABM_CHARGER_TYPE ? + * ABM_DISABLED - then no battery.charger.status will be avalible also no ups.status updates becouse L331 ? * ABM_UNKNOWN - like was in original code then battery.charger.status will be avalible */ - advanced_battery_monitoring = ABM_DISABLED; - upsdebugx(2, "Set ABM variable to disabled, charger type status: %i", advanced_battery_monitoring); + advanced_battery_monitoring = ABM_UNKNOWN; + upsdebugx(2, "Set ABM variable to unknown, charger type status: %i", advanced_battery_monitoring); } /* If ABM is already set in `eaton_abm_enabled_fun()`, do not overwrite */ @@ -428,7 +428,7 @@ static info_lkp_t eaton_charger_type_info[] = { static const char *eaton_abm_chrg_dischrg_fun(double value) { /* Don't process if ABM is disabled */ - if (advanced_battery_monitoring == ABM_DISABLED) + if ((advanced_battery_monitoring == ABM_DISABLED) || (advanced_battery_monitoring == ABM_UNKNOWN)) return NULL; /* if we have battery.charger.type for 9E Models and others */ @@ -1613,7 +1613,7 @@ static hid_info_t mge_hid2nut[] = /* Not published, just to store in internal var. advanced_battery_monitoring */ { "battery.charger.type", 0, 0, "UPS.BatterySystem.Charger.ChargerType", NULL, "%.0f", HU_FLAG_QUICK_POLL, eaton_charger_type_info }, { "battery.charger.status", 0, 0, "UPS.BatterySystem.Charger.ABMEnable", NULL, "%.0f", HU_FLAG_QUICK_POLL, eaton_abm_enabled_info }, - /* Same as above but for 9E Models that using ChargerType instead and other units that has ABM when .ChargerType=4 */ + /* Same as above but for 9E Models that using x.ChargerType instead and other units that has ABM when x.ChargerType = 4 */ { "battery.charger.status", 0, 0, "UPS.BatterySystem.Charger.ChargerType", NULL, "%.0f", HU_FLAG_QUICK_POLL, eaton_abm_enabled_type_info }, /* Same as the one above, but for legacy units */ /* Refer to Note 1 (This point will need more clarification!)