Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/nutdrv_qx_voltronic.c, NEWS.adoc: fix battery.runtime… #2768

Merged
merged 1 commit into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ https://github.com/networkupstools/nut/milestone/11
as known supported by `nutdrv_qx` (Megatec protocol) since at least
NUT v2.7.4 release. [#2395]
* introduced `innovart31` protocol support for Innova RT 3/1 UPSes. [#2712]
* extended Voltronic protocol to support longer numbers as remaining
`battery.runtime` value. [#2765]

- bicker_ser: added new driver for Bicker 12/24Vdc UPS via RS-232 serial
communication protocol, which supports any UPS shipped with the PSZ-1053
Expand Down
12 changes: 10 additions & 2 deletions drivers/nutdrv_qx_voltronic.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "nutdrv_qx.h"
#include "nutdrv_qx_voltronic.h"

#define VOLTRONIC_VERSION "Voltronic 0.08"
#define VOLTRONIC_VERSION "Voltronic 0.09"

/* Support functions */
static int voltronic_claim(void);
Expand Down Expand Up @@ -1128,13 +1128,21 @@ static item_t voltronic_qx2nut[] = {
* < [(026.5 02 01 068 255\r]
* 012345678901234567890
* 0 1 2
*
* NOTE: PowerWalker VFI 1500 CG PF1 as of
* https://github.com/networkupstools/nut/issues/2765
* reported a longer last component, so we do not expect
* an exact ending location here, just "to end of reply":
* < [(041.0 03 01 100 00037\r]
* 01234567890123456789012
* 0 1 2
*/

{ "battery.voltage", 0, NULL, "QBV\r", "", 21, '(', "", 1, 5, "%.2f", 0, NULL, NULL, qx_multiply_battvolt },
{ "battery_number", ST_FLAG_RW, voltronic_r_batt_numb, "QBV\r", "", 21, '(', "", 7, 9, "%d", QX_FLAG_SEMI_STATIC | QX_FLAG_RANGE | QX_FLAG_NONUT, NULL, NULL, voltronic_batt_numb }, /* Number of batteries that make a pack */
{ "battery.packs", ST_FLAG_RW, voltronic_r_batt_packs, "QBV\r", "", 21, '(', "", 10, 11, "%.0f", QX_FLAG_SEMI_STATIC | QX_FLAG_RANGE, NULL, NULL, NULL }, /* Number of battery packs in parallel */
{ "battery.charge", 0, NULL, "QBV\r", "", 21, '(', "", 13, 15, "%.0f", 0, NULL, NULL, NULL },
{ "battery.runtime", 0, NULL, "QBV\r", "", 21, '(', "", 17, 19, "%.0f", 0, NULL, NULL, voltronic_batt_runtime },
{ "battery.runtime", 0, NULL, "QBV\r", "", 21, '(', "", 17, 0, "%.0f", 0, NULL, NULL, voltronic_batt_runtime },

/* Query UPS for last seen min/max load level
* > [QLDL\r]
Expand Down
Loading