-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from Qrome/2.7
2.7
- Loading branch information
Showing
101 changed files
with
8,087 additions
and
1,780 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,54 @@ | ||
/** The MIT License (MIT) | ||
Copyright (c) 2018 David Payne | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
#pragma once | ||
#include <ESP8266WiFi.h> | ||
#include <ESP8266HTTPClient.h> | ||
#include <ArduinoJson.h> | ||
|
||
class BitcoinApiClient { | ||
|
||
private: | ||
|
||
String myCurrency = ""; | ||
|
||
const char* servername = "api.coindesk.com"; // remote server we will connect to https://www.coindesk.com/api/ | ||
|
||
typedef struct { | ||
String code; | ||
String rate; | ||
String description; | ||
float rate_float; | ||
} bpi; | ||
|
||
bpi bpiData; | ||
|
||
public: | ||
BitcoinApiClient(); | ||
void updateBitcoinData(String currencyCode); | ||
|
||
String getCode(); | ||
String getRate(); | ||
String getDescription(); | ||
float getRateFloat(); | ||
}; | ||
/** The MIT License (MIT) | ||
Copyright (c) 2018 David Payne | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
#pragma once | ||
#include <ESP8266WiFi.h> | ||
#include <ESP8266HTTPClient.h> | ||
#include "libs/ArduinoJson/ArduinoJson.h" | ||
|
||
class BitcoinApiClient { | ||
|
||
private: | ||
|
||
String myCurrency = ""; | ||
|
||
const char* servername = "api.coindesk.com"; // remote server we will connect to https://www.coindesk.com/api/ | ||
|
||
typedef struct { | ||
String code; | ||
String rate; | ||
String description; | ||
float rate_float; | ||
} bpi; | ||
|
||
bpi bpiData; | ||
|
||
public: | ||
BitcoinApiClient(); | ||
void updateBitcoinData(String currencyCode); | ||
|
||
String getCode(); | ||
String getRate(); | ||
String getDescription(); | ||
float getRateFloat(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,54 @@ | ||
/** The MIT License (MIT) | ||
Copyright (c) 2018 David Payne | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
#pragma once | ||
#include <ESP8266WiFi.h> | ||
#include <ArduinoJson.h> | ||
|
||
class GeoNamesClient { | ||
|
||
private: | ||
String myLat = ""; | ||
String myLon = ""; | ||
String myUserName = ""; | ||
boolean isDst = true; // Daylight Savings Time | ||
|
||
int hours = 0; | ||
int minutes = 0; | ||
String datetime = ""; | ||
|
||
const char* servername = "api.geonames.org"; // remote server we will connect to | ||
|
||
public: | ||
GeoNamesClient(String UserName, String lat, String lon, boolean useDst); | ||
void updateClient(String UserName, String lat, String lon, boolean useDst); | ||
float getTimeOffset(); | ||
String getHours(); | ||
String getMinutes(); | ||
String getYear(); | ||
String getMonth00(); | ||
String getMonth(boolean zeroPad); | ||
String getMonthName(); | ||
String getDay00(); | ||
String getDay(boolean zeroPad); | ||
}; | ||
/** The MIT License (MIT) | ||
Copyright (c) 2018 David Payne | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
#pragma once | ||
#include <ESP8266WiFi.h> | ||
#include "libs/ArduinoJson/ArduinoJson.h" | ||
|
||
class GeoNamesClient { | ||
|
||
private: | ||
String myLat = ""; | ||
String myLon = ""; | ||
String myUserName = ""; | ||
boolean isDst = true; // Daylight Savings Time | ||
|
||
int hours = 0; | ||
int minutes = 0; | ||
String datetime = ""; | ||
|
||
const char* servername = "api.geonames.org"; // remote server we will connect to | ||
|
||
public: | ||
GeoNamesClient(String UserName, String lat, String lon, boolean useDst); | ||
void updateClient(String UserName, String lat, String lon, boolean useDst); | ||
float getTimeOffset(); | ||
String getHours(); | ||
String getMinutes(); | ||
String getYear(); | ||
String getMonth00(); | ||
String getMonth(boolean zeroPad); | ||
String getMonthName(); | ||
String getDay00(); | ||
String getDay(boolean zeroPad); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,77 @@ | ||
/** The MIT License (MIT) | ||
Copyright (c) 2018 David Payne | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
#pragma once | ||
#include <ESP8266WiFi.h> | ||
#include <ArduinoJson.h> | ||
#include <base64.h> | ||
|
||
class OctoPrintClient { | ||
|
||
private: | ||
char myServer[100]; | ||
int myPort = 80; | ||
String myApiKey = ""; | ||
String encodedAuth = ""; | ||
|
||
void resetPrintData(); | ||
boolean validate(); | ||
|
||
String result; | ||
|
||
typedef struct { | ||
String averagePrintTime; | ||
String estimatedPrintTime; | ||
String fileName; | ||
String fileSize; | ||
String lastPrintTime; | ||
String progressCompletion; | ||
String progressFilepos; | ||
String progressPrintTime; | ||
String progressPrintTimeLeft; | ||
String state; | ||
String error; | ||
} PrinterStruct; | ||
|
||
PrinterStruct printerData; | ||
|
||
|
||
public: | ||
OctoPrintClient(String ApiKey, String server, int port, String user, String pass); | ||
void getPrinterJobResults(); | ||
void updateOctoPrintClient(String ApiKey, String server, int port, String user, String pass); | ||
|
||
String getAveragePrintTime(); | ||
String getEstimatedPrintTime(); | ||
String getFileName(); | ||
String getFileSize(); | ||
String getLastPrintTime(); | ||
String getProgressCompletion(); | ||
String getProgressFilepos(); | ||
String getProgressPrintTime(); | ||
String getProgressPrintTimeLeft(); | ||
String getState(); | ||
boolean isPrinting(); | ||
boolean isOperational(); | ||
String getError(); | ||
}; | ||
/** The MIT License (MIT) | ||
Copyright (c) 2018 David Payne | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
*/ | ||
|
||
#pragma once | ||
#include <ESP8266WiFi.h> | ||
#include "libs/ArduinoJson/ArduinoJson.h" | ||
#include <base64.h> | ||
|
||
class OctoPrintClient { | ||
|
||
private: | ||
char myServer[100]; | ||
int myPort = 80; | ||
String myApiKey = ""; | ||
String encodedAuth = ""; | ||
|
||
void resetPrintData(); | ||
boolean validate(); | ||
|
||
String result; | ||
|
||
typedef struct { | ||
String averagePrintTime; | ||
String estimatedPrintTime; | ||
String fileName; | ||
String fileSize; | ||
String lastPrintTime; | ||
String progressCompletion; | ||
String progressFilepos; | ||
String progressPrintTime; | ||
String progressPrintTimeLeft; | ||
String state; | ||
String error; | ||
} PrinterStruct; | ||
|
||
PrinterStruct printerData; | ||
|
||
|
||
public: | ||
OctoPrintClient(String ApiKey, String server, int port, String user, String pass); | ||
void getPrinterJobResults(); | ||
void updateOctoPrintClient(String ApiKey, String server, int port, String user, String pass); | ||
|
||
String getAveragePrintTime(); | ||
String getEstimatedPrintTime(); | ||
String getFileName(); | ||
String getFileSize(); | ||
String getLastPrintTime(); | ||
String getProgressCompletion(); | ||
String getProgressFilepos(); | ||
String getProgressPrintTime(); | ||
String getProgressPrintTimeLeft(); | ||
String getState(); | ||
boolean isPrinting(); | ||
boolean isOperational(); | ||
String getError(); | ||
}; |
Oops, something went wrong.