-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalendar_handler.h
More file actions
29 lines (24 loc) · 887 Bytes
/
calendar_handler.h
File metadata and controls
29 lines (24 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef CALENDAR_HANDLER_H
#define CALENDAR_HANDLER_H
#include <Arduino.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include "oauth_handler.h"
#include "tasks.h"
#include "bin_type.h"
class CalendarHandler {
public:
CalendarHandler(OAuthHandler& oauthHandler);
bool checkForBinEvents(bool& hasRecycling, bool& hasRubbish);
bool getAvailableCalendars(JsonDocument& calendars);
bool getUpcomingBinDays(JsonDocument& events);
private:
OAuthHandler& oauth;
String access_token;
const String CALENDAR_API_BASE = "https://www.googleapis.com/calendar/v3/calendars/";
static const int DAYS_TO_CHECK_BIN_SCHEDULE = 21;
String getISODate(int daysOffset = 0);
String urlEncode(const String& str);
bool isBinEvent(const String& summary, bool& isRecycling, bool& isRubbish) const;
};
#endif