EventChargingState not extending Event
This commit is contained in:
parent
e6c8ecdc2f
commit
1cb93c630d
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package info.nightscout.androidaps.events
|
||||
|
||||
class EventChargingState(val isCharging: Boolean) : Event()
|
|
@ -109,7 +109,7 @@ class NsClientReceiverDelegate {
|
|||
|
||||
boolean newAllowedState = true;
|
||||
|
||||
if (!ev.isCharging && chargingOnly) {
|
||||
if (!ev.isCharging() && chargingOnly) {
|
||||
newAllowedState = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue