mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-23 20:35:42 +02:00
module/battery: don't need 'energy' unless we're estimating time left
This commit is contained in:
parent
50b4bf3783
commit
1864d68961
1 changed files with 3 additions and 3 deletions
|
@ -63,13 +63,13 @@ content(struct module *mod)
|
|||
m->state == STATE_CHARGING ||
|
||||
m->state == STATE_DISCHARGING);
|
||||
|
||||
unsigned long energy = m->state == STATE_CHARGING
|
||||
? m->energy_full - m->energy : m->energy;
|
||||
|
||||
unsigned long hours;
|
||||
unsigned long minutes;
|
||||
|
||||
if (m->time_to_empty < 0) {
|
||||
unsigned long energy = m->state == STATE_CHARGING
|
||||
? m->energy_full - m->energy : m->energy;
|
||||
|
||||
double hours_as_float;
|
||||
if (m->state == STATE_FULL)
|
||||
hours_as_float = 0.0;
|
||||
|
|
Loading…
Add table
Reference in a new issue