mirror of
https://codeberg.org/dnkl/yambar.git
synced 2025-04-22 12:25:38 +02:00
module/battery: initialize state in constructor
This commit is contained in:
parent
f04ff31d0f
commit
65cfcfb2de
1 changed files with 8 additions and 0 deletions
|
@ -332,9 +332,17 @@ battery_new(const char *battery, struct particle *label, int poll_interval_secs)
|
|||
m->label = label;
|
||||
m->poll_interval = poll_interval_secs;
|
||||
m->battery = strdup(battery);
|
||||
|
||||
m->manufacturer = NULL;
|
||||
m->model = NULL;
|
||||
|
||||
m->energy_full_design = 0;
|
||||
m->energy_full = 0;
|
||||
m->state = STATE_DISCHARGING;
|
||||
m->capacity = 0;
|
||||
m->energy = 0;
|
||||
m->power = 0;
|
||||
|
||||
struct module *mod = module_common_new();
|
||||
mod->private = m;
|
||||
mod->run = &run;
|
||||
|
|
Loading…
Add table
Reference in a new issue