EventChargingState not extending Event

This commit is contained in:
Milos Kozak 2019-08-15 17:10:36 +02:00
parent e6c8ecdc2f
commit 1cb93c630d
4 changed files with 5 additions and 15 deletions

View file

@ -1,13 +0,0 @@
package info.nightscout.androidaps.events;
public class EventChargingState {
public boolean isCharging = false;
public EventChargingState() {}
public EventChargingState(boolean isCharging) {
this.isCharging = isCharging;
}
}

View file

@ -0,0 +1,3 @@
package info.nightscout.androidaps.events
class EventChargingState(val isCharging: Boolean) : Event()

View file

@ -109,7 +109,7 @@ class NsClientReceiverDelegate {
boolean newAllowedState = true;
if (!ev.isCharging && chargingOnly) {
if (!ev.isCharging() && chargingOnly) {
newAllowedState = false;
}

View file

@ -36,7 +36,7 @@ public class ChargingStateReceiver extends BroadcastReceiver {
}
static public boolean isCharging() {
return lastEvent != null && lastEvent.isCharging;
return lastEvent != null && lastEvent.isCharging();
}
static public EventChargingState getLastEvent() {