Hi there, @robbiet480. Would you consider this acceptable functionality for this library? I am building a prometheus exporter on top of the library and discovered that my UPS seems a little... silly.
There are things coming back from NUT that are NUMBERs, but related variables coming back as STRINGs.
Example:
GET TYPE ups battery.charge.low
TYPE ups battery.charge.low RW STRING:10
GET VAR ups battery.charge.low
VAR ups battery.charge.low "10"
GET TYPE ups battery.charge.warning
TYPE ups battery.charge.warning NUMBER
GET VAR ups battery.charge.warning
VAR ups battery.charge.warning "50"
This pull request examines the STRING types that are returned and coaxes them to integer or float64 as is done for UNKNOWN and NUMBER types. This could be considered a breaking change, so I could wrap this in a static configuration param (or parameter to GetVariables) if that would be preferred.
Hi there, @robbiet480. Would you consider this acceptable functionality for this library? I am building a prometheus exporter on top of the library and discovered that my UPS seems a little... silly.
There are things coming back from NUT that are NUMBERs, but related variables coming back as STRINGs.
Example:
This pull request examines the STRING types that are returned and coaxes them to integer or float64 as is done for
UNKNOWN
andNUMBER
types. This could be considered a breaking change, so I could wrap this in a static configuration param (or parameter toGetVariables
) if that would be preferred.