diff --git a/src/org/kde/kdeconnect/Plugins/BatteryPlugin/BatteryPlugin.java b/src/org/kde/kdeconnect/Plugins/BatteryPlugin/BatteryPlugin.java index 21a2eb82..d23ed3d0 100644 --- a/src/org/kde/kdeconnect/Plugins/BatteryPlugin/BatteryPlugin.java +++ b/src/org/kde/kdeconnect/Plugins/BatteryPlugin/BatteryPlugin.java @@ -15,8 +15,8 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ + * along with this program. If not, see . + */ package org.kde.kdeconnect.Plugins.BatteryPlugin; @@ -65,22 +65,17 @@ public class BatteryPlugin extends Plugin { boolean lowBattery = Intent.ACTION_BATTERY_LOW.equals(batteryIntent.getAction()); int thresholdEvent = lowBattery ? THRESHOLD_EVENT_BATTERY_LOW : THRESHOLD_EVENT_NONE; - if (isCharging == batteryInfo.getBoolean("isCharging") - && currentCharge == batteryInfo.getInt("currentCharge") - && thresholdEvent == batteryInfo.getInt("thresholdEvent") + if (isCharging != batteryInfo.getBoolean("isCharging") + || currentCharge != batteryInfo.getInt("currentCharge") + || thresholdEvent != batteryInfo.getInt("thresholdEvent") ) { - //Do not send again if nothing has changed - - } else { - batteryInfo.set("currentCharge", currentCharge); batteryInfo.set("isCharging", isCharging); batteryInfo.set("thresholdEvent", thresholdEvent); device.sendPacket(batteryInfo); } - } };