Skip to content

Commit 29d39ac

Browse files
upsset.c: Recognize RANGE NUMBER and NUMBER types.
Tested on Masterguard A1000 and A2000 units. Signed-off-by: Atanas Vladimirov <vladimirov.atanas@gmail.com>
1 parent c1c3d7f commit 29d39ac

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

NEWS.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ https://github.com/networkupstools/nut/milestone/12
179179
server. [issue #3003, PR #3110]
180180
* Tickle service watchdog timer (if any) so the `nut-monitor.service` or
181181
equivalent unit is not killed off due to quietness during shutdown. [#3003]
182+
183+
- `upsset` now recognize RANGE NUMBER and NUMBER types.
182184
+
183185
NOTE: If using `upssched` and monitoring multiple UPSes, consider setting up
184186
a `START-TIMER-SHARED` rule with a short (approx. 1 second) timeout to group

clients/upsset.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,19 @@ static void do_type(const char *varname)
770770
return;
771771
}
772772

773+
if (!strcasecmp(answer[i], "NUMBER")) {
774+
/* 20 is a reasonable default size for the text box */
775+
do_string(varname, 20);
776+
return;
777+
}
778+
779+
/* RANGE is usually paired with NUMBER.
780+
We can ignore 'RANGE' and let the 'NUMBER'
781+
case (which should come next) handle it. */
782+
if (!strcasecmp(answer[i], "RANGE")) {
783+
continue;
784+
}
785+
773786
/* ignore this one */
774787
if (!strcasecmp(answer[i], "RW"))
775788
continue;

0 commit comments

Comments
 (0)