30 lines
No EOL
605 B
C++
30 lines
No EOL
605 B
C++
#if !defined(_DWDWX_H)
|
|
#define _DWDWX_H
|
|
|
|
#include <WiFiClient.h>
|
|
#include <HTTPClient.h>
|
|
#include <ArduinoJson.h>
|
|
class DWDWXClient
|
|
{
|
|
public:
|
|
WiFiClient *_client;
|
|
String currentMessage;
|
|
|
|
explicit DWDWXClient(WiFiClient *client);
|
|
void begin(int intervalMinutes, float latitude, float longitude);
|
|
bool check();
|
|
void loop();
|
|
bool isDirty();
|
|
|
|
private:
|
|
bool _dirty;
|
|
unsigned long lastCheck = 0;
|
|
unsigned long checkInterval = 300000;
|
|
String dwdwxData;
|
|
// String dashboardUrl;
|
|
String url;
|
|
|
|
HTTPClient _http;
|
|
String parseJSON(String jsonData);
|
|
};
|
|
#endif |