Flag "battery_voltage_reports_one_pack" in nutdrv_qx is broken #2325
Labels
bug
impacts-release-2.8.1
Issues reported against NUT release 2.8.1 (maybe vanilla or with minor packaging tweaks)
Qx protocol driver
Driver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some others
Milestone
The
battery_voltage_reports_one_pack
flag was introduced in response to issue #1279. It's unclear why this flag was introduced, as the prior method of always multiplying the reported voltage by the number of packs was functional. Having the flag be false is the same end result asbattery.packs=1
, which should always be the case if thebattery_voltage_reports_one_pack
flag is not set.Regardless, the
battery_voltage_reports_one_pack
flag is broken as a result of commit [6fbb680].The problem is the access method used. The current code uses getval() to examine the setting. However, since
battery_voltage_reports_one_pack
is a flag rather than a variable, getval() will always return null. Function testvar() must be used instead.PR #2324 addresses this simple issue. However, it might be worth considering the removal of the flag completely as
battery.packs=1
represents the same functionality. If you would like me to prepare an alternate PR for this approach, please let me know.The text was updated successfully, but these errors were encountered: