2024-01-10 18:54:00 +01:00
|
|
|
/* Copyright (C) 2015-2024 Andreas Shimokawa, Daniele Gobbetti, José Rebelo,
|
|
|
|
Petr Vaněk
|
2017-03-10 14:53:19 +01:00
|
|
|
|
|
|
|
This file is part of Gadgetbridge.
|
|
|
|
|
|
|
|
Gadgetbridge is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Affero General Public License as published
|
|
|
|
by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Gadgetbridge is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
2024-01-10 18:54:00 +01:00
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
2015-08-18 17:37:51 +02:00
|
|
|
package nodomain.freeyourgadget.gadgetbridge.deviceevents;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.GregorianCalendar;
|
|
|
|
|
2015-08-27 11:50:31 +02:00
|
|
|
import nodomain.freeyourgadget.gadgetbridge.model.BatteryState;
|
|
|
|
|
2015-08-18 17:37:51 +02:00
|
|
|
public class GBDeviceEventBatteryInfo extends GBDeviceEvent {
|
2015-08-31 17:25:58 +02:00
|
|
|
public GregorianCalendar lastChargeTime = null;
|
2015-08-18 17:37:51 +02:00
|
|
|
public BatteryState state = BatteryState.UNKNOWN;
|
2021-10-16 22:40:30 +02:00
|
|
|
public int batteryIndex = 0;
|
|
|
|
public int level = 50;
|
2015-08-18 17:37:51 +02:00
|
|
|
public int numCharges = -1;
|
2018-07-28 17:23:58 +02:00
|
|
|
public float voltage = -1f;
|
2015-08-18 17:37:51 +02:00
|
|
|
|
2015-08-19 17:36:53 +02:00
|
|
|
public boolean extendedInfoAvailable() {
|
|
|
|
if (numCharges != -1 && lastChargeTime != null) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2015-08-18 17:37:51 +02:00
|
|
|
}
|