Skip to content

Commit

Permalink
Allow old weather service
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlich committed Dec 12, 2023
1 parent 54695e0 commit b8e0801
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions daemon/src/devices/pinetimejfdevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "infinitimenavservice.h"
#include "hrmservice.h"
#include "infinitimemotionservice.h"
//#include "infinitimeweatherservice.h"
#include "infinitimeweatherservice.h"
#include "simpleweatherservice.h"
#include "adafruitblefsservice.h"
#include "batteryservice.h"
Expand Down Expand Up @@ -154,8 +154,8 @@ void PinetimeJFDevice::parseServices()
addService(InfiniTimeMotionService::UUID_SERVICE_MOTION, new InfiniTimeMotionService(path, this));
} else if (uuid == SimpleWeatherService::UUID_SERVICE_SIMPLE_WEATHER && !service(SimpleWeatherService::UUID_SERVICE_SIMPLE_WEATHER)) {
addService(SimpleWeatherService::UUID_SERVICE_SIMPLE_WEATHER, new SimpleWeatherService(path, this));
// } else if (uuid == InfiniTimeWeatherService::UUID_SERVICE_WEATHER && !service(InfiniTimeWeatherService::UUID_SERVICE_WEATHER)) {
// addService(InfiniTimeWeatherService::UUID_SERVICE_WEATHER, new InfiniTimeWeatherService(path, this));
} else if (uuid == InfiniTimeWeatherService::UUID_SERVICE_WEATHER && !service(InfiniTimeWeatherService::UUID_SERVICE_WEATHER)) {
addService(InfiniTimeWeatherService::UUID_SERVICE_WEATHER, new InfiniTimeWeatherService(path, this));
} else if (uuid == AdafruitBleFsService::UUID_SERVICE_FS && !service(AdafruitBleFsService::UUID_SERVICE_FS)) {
size_t transferMtu = GetMtuForCharacteristic(path, AdafruitBleFsService::UUID_CHARACTERISTIC_FS_TRANSFER);
addService(AdafruitBleFsService::UUID_SERVICE_FS, new AdafruitBleFsService(path, this, transferMtu));
Expand Down Expand Up @@ -437,11 +437,10 @@ void PinetimeJFDevice::serviceEvent(const QString &characteristic, uint8_t event

void PinetimeJFDevice::sendWeather(CurrentWeather *weather)
{
// InfiniTimeWeatherService *w = qobject_cast<InfiniTimeWeatherService*>(service(InfiniTimeWeatherService::UUID_SERVICE_WEATHER));
// if (w){
// w->sendWeather(weather);
// }

InfiniTimeWeatherService *w = qobject_cast<InfiniTimeWeatherService*>(service(InfiniTimeWeatherService::UUID_SERVICE_WEATHER));
if (w){
w->sendWeather(weather);
}

SimpleWeatherService *sw = qobject_cast<SimpleWeatherService*>(service(SimpleWeatherService::UUID_SERVICE_SIMPLE_WEATHER));

Expand Down

0 comments on commit b8e0801

Please sign in to comment.