Skip to content

Commit

Permalink
drivers/nutdrv_qx_voltronic.c, NEWS.adoc: fix battery.runtime for new…
Browse files Browse the repository at this point in the history
…er protocol dialect [networkupstools#2765]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Jan 16, 2025
1 parent 2dbb8b0 commit bba737f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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

0 comments on commit bba737f

Please sign in to comment.