mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Cleanup of Huawei weather implementation
This commit is contained in:
parent
1c2516186d
commit
c66051f580
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2024 Damien Gaignon, Martin.JM
|
||||
/* Copyright (C) 2024 Damien Gaignon, Martin.JM, Vitalii Tomin
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
|
@ -1,3 +1,20 @@
|
||||
/* Copyright (C) 2024 Vitalii Tomin, Martin.JM
|
||||
|
||||
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
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
package nodomain.freeyourgadget.gadgetbridge.devices.huawei.packets;
|
||||
|
||||
import nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiPacket;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2024 Damien Gaignon, Martin.JM
|
||||
/* Copyright (C) 2024 Damien Gaignon, Martin.JM, Vitalii Tomin
|
||||
|
||||
This file is part of Gadgetbridge.
|
||||
|
||||
|
@ -1,3 +1,20 @@
|
||||
/* Copyright (C) 2024 Vitalii Tomin, Martin.JM
|
||||
|
||||
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
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
package nodomain.freeyourgadget.gadgetbridge.service.devices.huawei.requests;
|
||||
|
||||
import java.util.Calendar;
|
||||
@ -20,13 +37,10 @@ public class SendGpsAndTimeToDeviceRequest extends Request {
|
||||
@Override
|
||||
protected List<byte[]> createRequest() throws RequestCreationException {
|
||||
try {
|
||||
// TODO: support multiple units
|
||||
|
||||
Prefs prefs = GBApplication.getPrefs();
|
||||
// Backdating a bit seems to work better
|
||||
return new GpsAndTime.CurrentGPSRequest(
|
||||
this.paramsProvider,
|
||||
(int) (Calendar.getInstance().getTime().getTime() / 1000L) - 60,
|
||||
(int) (Calendar.getInstance().getTime().getTime() / 1000L) - 60, // Backdating a bit seems to work better
|
||||
prefs.getFloat("location_latitude", 0.0F),
|
||||
prefs.getFloat("location_longitude", 0.0F)
|
||||
).serialize();
|
||||
|
Loading…
Reference in New Issue
Block a user