Skip to content

Commit

Permalink
drivers/liebert-gxe.c: fix bad backup time report
Browse files Browse the repository at this point in the history
It seems `battery.runtime` should be used for battery backup time instead `.low` one. Also the division was also faulty probably because I copied and pasted the code from previous lines but the manual says it shouldn't be there.

The commit should give correct backup time readings and corrected variable name.

Signed-off-by: Gong Zhile <[email protected]>
  • Loading branch information
goodspeed34 committed Jan 4, 2025
1 parent 99ea972 commit 518c527
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/liebert-gxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ static void upsdrv_updateinfo_analog(void)
/* Field 19, AC_OUT POWER, kVA */
dstate_setinfo("ups.power", "%d",
ydn23_val_from_hex(YDN23_FRAME_REG(frame, 35), 4)*10);
/* Field 22, BATTERY BACKUP TIME, Min */
dstate_setinfo("battery.runtime.low", "%.2f",
ydn23_val_from_hex(YDN23_FRAME_REG(frame, 41), 4)/100.0f*60.0f);
/* Field 22, BATTERY BACKUP TIME, Minutes */
dstate_setinfo("battery.runtime", "%d",
ydn23_val_from_hex(YDN23_FRAME_REG(frame, 41), 4)*60);

dstate_dataok();
}
Expand Down

0 comments on commit 518c527

Please sign in to comment.