mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-10 17:11:56 +01:00
Moyoung: Send cached weather info on request
This commit is contained in:
parent
809840be19
commit
c0878cd214
@ -90,6 +90,7 @@ import nodomain.freeyourgadget.gadgetbridge.model.CallSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.DeviceService;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.NotificationSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.RecordedDataTypes;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.Weather;
|
||||
import nodomain.freeyourgadget.gadgetbridge.model.WeatherSpec;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.AbstractBTLEDeviceSupport;
|
||||
import nodomain.freeyourgadget.gadgetbridge.service.btle.BLETypeConversions;
|
||||
@ -381,8 +382,11 @@ public class MoyoungDeviceSupport extends AbstractBTLEDeviceSupport {
|
||||
|
||||
if (packetType == MoyoungConstants.CMD_NOTIFY_WEATHER_CHANGE)
|
||||
{
|
||||
LOG.info("The watch really wants us to transmit the weather data for some reason...");
|
||||
// TODO: transmit weather
|
||||
LOG.info("Will transmit cached weather (if any) since the watch asks for it");
|
||||
if (Weather.getInstance().getWeatherSpec() != null) {
|
||||
final ArrayList<WeatherSpec> specs = new ArrayList<>(Weather.getInstance().getWeatherSpecs());
|
||||
GBApplication.deviceService().onSendWeather(specs);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user