[Nut-upsdev] Some questions on driver implementation and variable names

Carlos Rodrigues carlos.efr at mail.telepac.pt
Sun Feb 25 15:52:54 CET 2007


On 2/25/07, Edgar Fuß <ef at math.uni-bonn.de> wrote:
> In case there is some variable (like ups.power) the UPS does not
> directly exhibit, but which can be computed by other known values
> (nominal power, load); should I compute and set that variable or
> should I only set values directly obtained form the UPS?

Well, there's no need to limit the output to values directly obtained
from the UPS. The driver can calculate some stuff, like the battery
runtime, the battery charge (percentage) and so on. Basically, the
driver should calculate values that may be useful for the user, as
long at they're somewhat dependent on the particular UPS it is
driving.

Basically, a driver should calculate stuff so that the hardware looks
fancier than it actually is, but it should not implement features that
are better off in some layer above the driver.

-- 
Carlos Rodrigues



More information about the Nut-upsdev mailing list