79 int httpCode, ret = 0;
82 WiFiClientSecure *client =
new WiFiClientSecure;
83 client->setCACert(taiga_cert);
89 https.addHeader(
"Content-Type",
"application/json", 0, 0);
95 if (httpCode == HTTP_CODE_OK) {
96 DEBUG.printf(
"[HTTP] AUTH SUCCESS\r\n");
101 https.writeToStream(&parser);
103 DEBUG.printf(
"[HTTP] AUTH... failed, error: %s\r\n", https.errorToString(httpCode).c_str());
122 https.addHeader(
"Authorization",
token, 0, 0);
123 httpCode = https.GET();
125 if (httpCode == HTTP_CODE_OK) {
126 DEBUG.printf(
"[HTTP] SLUG SUCCESS\r\n");
131 https.writeToStream(&parser);
133 DEBUG.printf(
"[HTTP] SLUG... failed, error: %s\r\n", https.errorToString(httpCode).c_str());
150 https.addHeader(
"Authorization",
token, 0, 0);
151 httpCode = https.GET();
153 if (httpCode == HTTP_CODE_OK) {
154 DEBUG.printf(
"[HTTP] TASKS SUCCESS\r\n");
159 https.writeToStream(&parser);
161 DEBUG.printf(
"[HTTP] TASKS... failed, error: %s\r\n", https.errorToString(httpCode).c_str());
173 int httpCode, ret = 0;
176 WiFiClientSecure *client =
new WiFiClientSecure;
177 client->setCACert(todoist_cert);
183 https.addHeader(
"Content-Type",
"application/json", 0, 0);
184 https.addHeader(
"Authorization",
token, 0, 0);
186 httpCode = https.GET();
188 if (httpCode == HTTP_CODE_OK) {
189 DEBUG.printf(
"[HTTP] AUTH SUCCESS\r\n");
194 https.writeToStream(&parser);
196 DEBUG.printf(
"[HTTP] AUTH... failed, error: %d::%s\r\n", httpCode, https.errorToString(httpCode).c_str());
210 uint16_t wt, ht, char_ht, prev_height = y, prev_width = x;
211 uint16_t i = 0, j = 0, start_height = 0;
215 display.setTextSize(1);
217 display.getTextBounds(F(
"To-Do List"), 0, 0, &xt, &yt, &wt, &ht);
218 display.setCursor(prev_width + 5, prev_height + ht);
221 display.println(F(
"To-Do List"));
223 display.setFont(
font);
225 display.getTextBounds(
"W", 0, 0, &xt, &yt, &wt, &char_ht);
228 start_height = prev_height + ht + 5;
229 for (j = 0; j < columns; j++) {
230 prev_height = start_height;
231 for (i = 0; i + (j * rows) <
task_count && i < rows; i++) {
232 String task =
tasks[i + (j * rows)];
233 uint16_t cnt = task.length();
235 task = task.substring(0, cnt);
236 display.getTextBounds(task.c_str(), 0, 0, &xt, &yt, &wt, &ht);
237 }
while (wt > max_line_width && cnt-- > 0);
239 DEBUG.printf(
"Task: %s\r\n", task.c_str());
240 display.setCursor(prev_width, prev_height);
241 display.printf(
"%s", task.c_str());
242 prev_height += char_ht + 7;
244 prev_width += max_line_width + 10;