[Nut-upsdev] [nut-commits] svn commit r1204 - in trunk: . drivers

Arjen de Korte nut+devel at de-korte.org
Sat Dec 29 21:44:58 UTC 2007


Carlos Rodrigues wrote:

> Author: carlosefr-guest
> Date: Sat Dec 29 20:17:01 2007
> New Revision: 1204
> 
> Log:
> - drivers/megatec.c: detect OB status while OFF.

You've changed a bit more than this line suggests.

[...]

> @@ -565,10 +575,16 @@
>  	dstate_setinfo("input.voltage.fault", "%.1f", query.fvolt);
>  	dstate_setinfo("output.voltage", "%.1f", query.ovolt);
>  	dstate_setinfo("ups.load", "%.1f", query.load);
> -	dstate_setinfo("input.frequency", "%.1f", query.freq);
>  	dstate_setinfo("battery.voltage", "%.2f", query.battvolt);
>  	dstate_setinfo("ups.temperature", "%.1f", query.temp);
>  
> +	/*
> +	 * The specification states this must be the input frequency, but
> +	 * some vendors use it as the output frequency. The safest bet is
> +	 * to just show the value without context and let the user decide.
> +	 */
> +	dstate_setinfo("frequency", "%.1f", query.freq);
> +
>  	charge = get_battery_charge(query.battvolt);
>  	if (charge >= 0) {
>  		dstate_setinfo("battery.charge", "%.1f", charge);

If the specification says 'input frequency', that's what it is. If some
vendors don't follow this, that's their problem. In any case I'm very
much against breaking the NUT variable naming convention for something
like this.

If this really is a consern (which I very much doubt), I suggest to
either drop this variable completely or reverse this change and put a
note in the man page that some devices don't follow the specification here.

Best regards, Arjen



More information about the Nut-upsdev mailing list