Skip to content

Commit 11fc9fd

Browse files
authored
Merge pull request #75 from Qrome/2.5
2.5
2 parents ea69172 + 1854675 commit 11fc9fd

File tree

96 files changed

+6414
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+6414
-98
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,14 @@ Use the Arduino guide for details on how to installing and manage libraries http
8282
**Packages** -- the following packages and libraries are used (download and install):
8383
ESP8266WiFi.h
8484
ESP8266WebServer.h
85-
ArduinoJson.h --> https://github.com/bblanchon/ArduinoJson (Version 5.13.X)
8685
WiFiManager.h --> https://github.com/tzapu/WiFiManager
8786
ESP8266mDNS.h
8887
ArduinoOTA.h --> Arduino OTA Library
8988
"SSD1306Wire.h" --> https://github.com/ThingPulse/esp8266-oled-ssd1306
9089
"OLEDDisplayUi.h"
9190

91+
Note Printer-Monitor version 2.5 and later include ArduinoJson (version 5.13.1).
92+
9293
## Initial Configuration
9394
All settings may be managed from the Web Interface, however, you may update the **Settings.h** file manually -- but it is not required. There is also an option to display current weather when the print is off-line.
9495
* Your OctoPrint API Key from your OctoPrint -> User Settings -> Current API Key

printermonitor/OctoPrintClient.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ SOFTWARE.
2626

2727
#pragma once
2828
#include <ESP8266WiFi.h>
29-
#include <ArduinoJson.h>
29+
#include "libs/ArduinoJson/ArduinoJson.h"
3030
#include <base64.h>
3131

3232
class OctoPrintClient {

printermonitor/OpenWeatherMapClient.h

+88-89
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,89 @@
1-
/** The MIT License (MIT)
2-
3-
Copyright (c) 2018 David Payne
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
22-
*/
23-
24-
#pragma once
25-
#include <ESP8266WiFi.h>
26-
#include <ArduinoJson.h>
27-
28-
class OpenWeatherMapClient {
29-
30-
private:
31-
String myCityIDs = "";
32-
String myApiKey = "";
33-
String units = "";
34-
String lang = "";
35-
36-
const char* servername = "api.openweathermap.org"; // remote server we will connect to
37-
String result;
38-
39-
typedef struct {
40-
String lat;
41-
String lon;
42-
String dt;
43-
String city;
44-
String country;
45-
String temp;
46-
String humidity;
47-
String condition;
48-
String wind;
49-
String weatherId;
50-
String description;
51-
String icon;
52-
boolean cached;
53-
String error;
54-
} weather;
55-
56-
weather weathers[5];
57-
58-
String roundValue(String value);
59-
60-
public:
61-
OpenWeatherMapClient(String ApiKey, int CityIDs[], int cityCount, boolean isMetric, String language);
62-
void updateWeather();
63-
void updateWeatherApiKey(String ApiKey);
64-
void updateCityIdList(int CityIDs[], int cityCount);
65-
void updateLanguage(String language);
66-
void setMetric(boolean isMetric);
67-
68-
String getWeatherResults();
69-
70-
String getLat(int index);
71-
String getLon(int index);
72-
String getDt(int index);
73-
String getCity(int index);
74-
String getCountry(int index);
75-
String getTemp(int index);
76-
String getTempRounded(int index);
77-
String getHumidity(int index);
78-
String getHumidityRounded(int index);
79-
String getCondition(int index);
80-
String getWind(int index);
81-
String getWindRounded(int index);
82-
String getWeatherId(int index);
83-
String getDescription(int index);
84-
String getIcon(int index);
85-
boolean getCached();
86-
String getMyCityIDs();
87-
String getWeatherIcon(int index);
88-
String getError();
89-
};
1+
/** The MIT License (MIT)
902
3+
Copyright (c) 2018 David Payne
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+
*/
23+
24+
#pragma once
25+
#include <ESP8266WiFi.h>
26+
#include "libs/ArduinoJson/ArduinoJson.h"
27+
28+
class OpenWeatherMapClient {
29+
30+
private:
31+
String myCityIDs = "";
32+
String myApiKey = "";
33+
String units = "";
34+
String lang = "";
35+
36+
const char* servername = "api.openweathermap.org"; // remote server we will connect to
37+
String result;
38+
39+
typedef struct {
40+
String lat;
41+
String lon;
42+
String dt;
43+
String city;
44+
String country;
45+
String temp;
46+
String humidity;
47+
String condition;
48+
String wind;
49+
String weatherId;
50+
String description;
51+
String icon;
52+
boolean cached;
53+
String error;
54+
} weather;
55+
56+
weather weathers[5];
57+
58+
String roundValue(String value);
59+
60+
public:
61+
OpenWeatherMapClient(String ApiKey, int CityIDs[], int cityCount, boolean isMetric, String language);
62+
void updateWeather();
63+
void updateWeatherApiKey(String ApiKey);
64+
void updateCityIdList(int CityIDs[], int cityCount);
65+
void updateLanguage(String language);
66+
void setMetric(boolean isMetric);
67+
68+
String getWeatherResults();
69+
70+
String getLat(int index);
71+
String getLon(int index);
72+
String getDt(int index);
73+
String getCity(int index);
74+
String getCountry(int index);
75+
String getTemp(int index);
76+
String getTempRounded(int index);
77+
String getHumidity(int index);
78+
String getHumidityRounded(int index);
79+
String getCondition(int index);
80+
String getWind(int index);
81+
String getWindRounded(int index);
82+
String getWeatherId(int index);
83+
String getDescription(int index);
84+
String getIcon(int index);
85+
boolean getCached();
86+
String getMyCityIDs();
87+
String getWeatherIcon(int index);
88+
String getError();
89+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// ArduinoJson - arduinojson.org
2+
// Copyright Benoit Blanchon 2014-2018
3+
// MIT License
4+
5+
#include "src/ArduinoJson.h"

0 commit comments

Comments
 (0)