Skip to content

Commit 89abe2d

Browse files
authored
Merge pull request networkupstools#3284 from jimklimov/issue-3281
arduino-hid: add `ups.load`, `input.voltage`, `output.voltage`…
2 parents ef02192 + a55c3f4 commit 89abe2d

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

NEWS.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ https://github.com/networkupstools/nut/milestone/12
249249
continues polling rather than triggering expensive reconnection attempts.
250250
True disconnections are still detected via other error codes or when all
251251
polls fail. [issue #3116]
252+
* `arduino-hid` subdriver enhanced with `ups.load`, `input.voltage` and
253+
`output.voltage` readings where supported (e.g. Ugreen US3000). [#3281]
252254

253255
- `nut-scanner` tool updates:
254256
* Fixed `nut-scanner` search for "simulation devices" to not use only the

docs/nut.dict

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
personal_ws-1.1 en 3645 utf-8
1+
personal_ws-1.1 en 3646 utf-8
22
AAC
33
AAS
44
ABI
@@ -1434,6 +1434,7 @@ UUU
14341434
UUUU
14351435
UX
14361436
Ubuntu
1437+
Ugreen
14371438
Ulf
14381439
Ulfat
14391440
Uncomment

drivers/arduino-hid.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "main.h" /* for getval() */
3737
#include "usb-common.h"
3838

39-
#define ARDUINO_HID_VERSION "Arduino HID 0.21"
39+
#define ARDUINO_HID_VERSION "Arduino HID 0.22"
4040
/* FIXME: experimental flag to be put in upsdrv_info */
4141

4242
/* Arduino */
@@ -110,6 +110,10 @@ static hid_info_t arduino_hid2nut[] = {
110110
{ "battery.charge.low", 0, 0, "UPS.PowerSummary.RemainingCapacityLimit", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL},
111111
{ "battery.charge.warning", 0, 0, "UPS.PowerSummary.WarningCapacityLimit", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL},
112112

113+
{ "ups.load", 0, 0, "UPS.PowerSummary.PercentLoad", NULL, "%.0f", 0, NULL },
114+
{ "input.voltage", 0, 0, "UPS.PowerConverter.Input.[1].Voltage", NULL, "%.1f", 0, NULL },
115+
{ "output.voltage", 0, 0, "UPS.PowerConverter.Output.Voltage", NULL, "%.1f", 0, NULL },
116+
113117
/* USB HID PresentStatus Flags
114118
TODO: Parse these into battery.charger.status
115119
*/

0 commit comments

Comments
 (0)