Skip to content

Commit

Permalink
add eco_mode info
Browse files Browse the repository at this point in the history
Signed-off-by: DaRK AnGeL <[email protected]>
  • Loading branch information
masterwishx committed Sep 30, 2024
1 parent 0fb27ae commit c89b245
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/usbhid-ups.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ static status_lkp_t status_info[] = {
{ "boost", STATUS(BOOST) },
{ "bypassauto", STATUS(BYPASSAUTO) },
{ "bypassman", STATUS(BYPASSMAN) },
{ "ecomode", STATUS(ECOMODE) },
{ "off", STATUS(OFF) },
{ "cal", STATUS(CALIB) },
{ "overheat", STATUS(OVERHEAT) },
Expand Down Expand Up @@ -371,6 +372,12 @@ info_lkp_t bypass_manual_info[] = {
{ 0, "!bypassman", NULL, NULL },
{ 0, NULL, NULL, NULL }
};
info_lkp_t eco_mode_info[] = {
{ 0, "normal", NULL, NULL },
{ 1, "high-efficiency", NULL, NULL },
{ 2, "ESS", NULL, NULL }, /* makes sense for UPS that implements this mode */
{ 0, NULL, NULL, NULL }
};
/* note: this value is reverted (0=set, 1=not set). We report "being
off" rather than "being on", so that devices that don't implement
this variable are "on" by default */
Expand Down Expand Up @@ -2086,6 +2093,9 @@ static void ups_alarm_set(void)
if (ups_status & STATUS(BYPASSMAN)) {
alarm_set("Manual bypass mode!");
}
if (ups_status & STATUS(ECOMODE)) {
alarm_set("HE/ECO mode!");
}
}

/* Return the current value of ups_status */
Expand Down
1 change: 1 addition & 0 deletions drivers/usbhid-ups.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ typedef enum {
BOOST, /* SmartBoost */
BYPASSAUTO, /* on automatic bypass */
BYPASSMAN, /* on manual/service bypass */
ECOMODE, /* High Efficiency (aka ECO Mode) */
OFF, /* ups is off */
CALIB, /* calibration */
OVERHEAT, /* overheat; Belkin, TrippLite */
Expand Down

0 comments on commit c89b245

Please sign in to comment.