fix(battery): Prevent broadcast if values are unchanged
This commit is contained in:
parent
d0e12fdcd0
commit
ea15f4a5de
@ -142,6 +142,9 @@ bool BatteryModule::on_event(InotifyEvent *event)
|
|||||||
state = STATE_FULL;
|
state = STATE_FULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this->state == state && this->percentage == percentage)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!this->label_charging_tokenized)
|
if (!this->label_charging_tokenized)
|
||||||
this->label_charging_tokenized = this->label_charging->clone();
|
this->label_charging_tokenized = this->label_charging->clone();
|
||||||
if (!this->label_discharging_tokenized)
|
if (!this->label_discharging_tokenized)
|
||||||
|
Loading…
Reference in New Issue
Block a user