Skip to content

Commit

Permalink
apcupsd-ups: interpret "SHUTTING DOWN" as "LB"
Browse files Browse the repository at this point in the history
Fix issue #460 so NUT with
apcupsd-ups driver will correctly initiate a shut down on low battery.

Closes: #460
Closes: #461
  • Loading branch information
tobby88 authored and clepple committed Aug 13, 2017
1 parent 1684875 commit 152e79c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/apcupsd-ups.c
Expand Up @@ -54,9 +54,8 @@ static void process(char *item,char *data)
{
case DU_FLAG_STATUS:
status_init();
if(!strcmp(data,"COMMLOST")||!strcmp(data,"SHUTTING DOWN")||
!strcmp(data,"NETWORK ERROR")||!strcmp(data,"ERROR"))
status_set("OFF");
if(!strcmp(data,"COMMLOST")||!strcmp(data,"NETWORK ERROR")||
!strcmp(data,"ERROR"))status_set("OFF");
else if(!strcmp(data,"SELFTEST"))status_set("OB");
else for(;(data=strtok(data," "));data=NULL)
{
Expand All @@ -66,7 +65,8 @@ static void process(char *item,char *data)
else if(!strcmp(data,"ONLINE"))status_set("OL");
else if(!strcmp(data,"ONBATT"))status_set("OB");
else if(!strcmp(data,"OVERLOAD"))status_set("OVER");
else if(!strcmp(data,"LOWBATT"))status_set("LB");
else if(!strcmp(data,"SHUTTING DOWN")||
!strcmp(data,"LOWBATT"))status_set("LB");
else if(!strcmp(data,"REPLACEBATT"))status_set("RB");
else if(!strcmp(data,"NOBATT"))status_set("BYPASS");
}
Expand Down

0 comments on commit 152e79c

Please sign in to comment.