From ea15f4a5de787e39f045c10ac46d8b7e9960f63a Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Tue, 14 Jun 2016 05:24:56 +0200 Subject: [PATCH] fix(battery): Prevent broadcast if values are unchanged --- src/modules/battery.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/battery.cpp b/src/modules/battery.cpp index b0f7525b..759fc891 100644 --- a/src/modules/battery.cpp +++ b/src/modules/battery.cpp @@ -142,6 +142,9 @@ bool BatteryModule::on_event(InotifyEvent *event) state = STATE_FULL; } + if (this->state == state && this->percentage == percentage) + return false; + if (!this->label_charging_tokenized) this->label_charging_tokenized = this->label_charging->clone(); if (!this->label_discharging_tokenized)