[Nut-upsdev] R: Nut-upsdev Digest, Vol 152, Issue 5

Daniele Pezzini hyouko at gmail.com
Sat Mar 17 18:00:25 UTC 2018

Elio, you flagged 'ups.delay.{shutdown,reboot}' as 'ST_FLAG_RW' (and
set their maximum length with dstate_setaux()): is the user really
expected to be able to change those vars? If not, don't bother with
flags or length; otherwise, you should also provide a 'upsh.setvar'.

Also, if those vars are actually writable, I would suggest to:
- if they are always numeric and if possible, flag them as
'ST_FLAG_NUMBER' (or, at least, not as 'ST_FLAG_STRING'),
- set their boundaries, if known, with dstate_addenum() or, if
appropriate, with dstate_addrange(),
- if they don't set values in the device, but only in NUT, add (and
document in riello_{ser,usb} man pages) corresponding options to be
set in ups.conf (or using the `-x var=value` command line option),
since the driver, when launched with the `-k` flag or through
`upsdrvctl shutdown`, cannot be aware of any 'transient' change made

See http://new.networkupstools.org/docs/developer-guide.chunked/ar01s04.html

Lastly, since you are already on GitHub, feel free to open a pull
request there for any proposed change.

More information about the Nut-upsdev mailing list