Imported Upstream version 2.6.5

This commit is contained in:
Laurent Bigonville 2012-08-12 23:39:31 +02:00
parent fefe62b2bd
commit a1fa151fc7
201 changed files with 7974 additions and 709 deletions

View file

@ -717,6 +717,10 @@ void upsdrv_makevartable(void)
upsdebugx(1, "upsdrv_makevartable...");
snprintf(temp, sizeof(temp), "Set low battery level, in %% (default=%s).", DEFAULT_LOWBATT);
addvar (VAR_VALUE, HU_VAR_LOWBATT, temp);
snprintf(temp, sizeof(temp), "Set shutdown delay, in seconds (default=%s)", DEFAULT_OFFDELAY);
addvar(VAR_VALUE, HU_VAR_OFFDELAY, temp);
@ -738,6 +742,8 @@ void upsdrv_makevartable(void)
addvar(VAR_VALUE, "productid", "Regular expression to match UPS Product numerical ID (4 digits hexadecimal)");
addvar(VAR_VALUE, "bus", "Regular expression to match USB bus name");
addvar(VAR_FLAG, "explore", "Diagnostic matching of unsupported UPS");
#else
addvar(VAR_VALUE, "notification", "Set notification type, (ignored, only for backward compatibility)");
#endif
}
@ -855,7 +861,6 @@ void upsdrv_initinfo(void)
upsdebugx(1, "upsdrv_initinfo...");
dstate_setinfo("driver.version.data", "%s", subdriver->name);
dstate_setinfo("driver.version.internal", DRIVER_VERSION);
/* init polling frequency */
val = getval(HU_VAR_POLLFREQ);
@ -939,6 +944,14 @@ void upsdrv_initups(void)
fatalx(EXIT_FAILURE, "Can't initialize data from HID UPS");
}
if (dstate_getinfo("battery.charge.low")) {
/* Retrieve user defined battery settings */
val = getval(HU_VAR_LOWBATT);
if (val) {
dstate_setinfo("battery.charge.low", "%ld", strtol(val, NULL, 10));
}
}
if (dstate_getinfo("ups.delay.start")) {
/* Retrieve user defined delay settings */
val = getval(HU_VAR_ONDELAY);