mirror of
https://github.com/JADE-Jerry/jcalendar.git
synced 2025-12-14 13:28:13 +08:00
1.0.23
This commit is contained in:
@@ -110,6 +110,9 @@ A: 1. 换根质量较好的或短一些的USB线,或换个USB口插入。 <br>
|
|||||||
A: 仅刷新app固件后,配置是保留的,所以,无需重新配置。如果刷新了分区表partition.bin,会将esp的nvs区刷新,这时候需要重新配置。
|
A: 仅刷新app固件后,配置是保留的,所以,无需重新配置。如果刷新了分区表partition.bin,会将esp的nvs区刷新,这时候需要重新配置。
|
||||||
|
|
||||||
## Releases
|
## Releases
|
||||||
|
### 1.0.23
|
||||||
|
* Refine: 修改和风天气请求url。
|
||||||
|
* Fix: bug(获取holiday返回码)。
|
||||||
### 1.0.22
|
### 1.0.22
|
||||||
* 项目开源:此项目使用GNU General Public License v3.0许可证授权。详情请参阅LICENSE文件。
|
* 项目开源:此项目使用GNU General Public License v3.0许可证授权。详情请参阅LICENSE文件。
|
||||||
* Refine:农历计算功能移出。(农历功能作为独立库,以MIT协议开源)
|
* Refine:农历计算功能移出。(农历功能作为独立库,以MIT协议开源)
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ public:
|
|||||||
bool getWeatherNow(Weather& result, const char* key, const char* locid) {
|
bool getWeatherNow(Weather& result, const char* key, const char* locid) {
|
||||||
// return getRestfulAPI("https://www.baidu.com", [&result](JsonDocument& json) {
|
// return getRestfulAPI("https://www.baidu.com", [&result](JsonDocument& json) {
|
||||||
return getRestfulAPI(
|
return getRestfulAPI(
|
||||||
"https://devapi.qweather.com/v7/weather/now?key=" + String(key) + "&location=" + String(locid), [&result](JsonDocument& json) {
|
"https://api.qweather.com/v7/weather/now?key=" + String(key) + "&location=" + String(locid), [&result](JsonDocument& json) {
|
||||||
if (strcmp(json["code"], "200") != 0) {
|
if (strcmp(json["code"], "200") != 0) {
|
||||||
Serial.print(F("Get weather failed, error: "));
|
Serial.print(F("Get weather failed, error: "));
|
||||||
Serial.println(json["code"].as<const char*>());
|
Serial.println(json["code"].as<const char*>());
|
||||||
@@ -189,7 +189,7 @@ public:
|
|||||||
|
|
||||||
// 和风天气 - 逐小时天气预报: https://dev.qweather.com/docs/api/weather/weather-hourly-forecast/
|
// 和风天气 - 逐小时天气预报: https://dev.qweather.com/docs/api/weather/weather-hourly-forecast/
|
||||||
bool getForecastHourly(HourlyForecast& result, const char* key, const char* locid) {
|
bool getForecastHourly(HourlyForecast& result, const char* key, const char* locid) {
|
||||||
return getRestfulAPI("https://devapi.qweather.com/v7/weather/24h?key=" + String(key) + "&location=" + String(locid), [&result](JsonDocument& json) {
|
return getRestfulAPI("https://api.qweather.com/v7/weather/24h?key=" + String(key) + "&location=" + String(locid), [&result](JsonDocument& json) {
|
||||||
if (strcmp(json["code"], "200") != 0) {
|
if (strcmp(json["code"], "200") != 0) {
|
||||||
Serial.print(F("Get hourly forecast failed, error: "));
|
Serial.print(F("Get hourly forecast failed, error: "));
|
||||||
Serial.println(json["code"].as<const char*>());
|
Serial.println(json["code"].as<const char*>());
|
||||||
@@ -217,7 +217,7 @@ public:
|
|||||||
|
|
||||||
// 和风天气 - 逐天天气预报: https://dev.qweather.com/docs/api/weather/weather-daily-forecast/
|
// 和风天气 - 逐天天气预报: https://dev.qweather.com/docs/api/weather/weather-daily-forecast/
|
||||||
bool getForecastDaily(DailyForecast& result, const char* key, const char* locid) {
|
bool getForecastDaily(DailyForecast& result, const char* key, const char* locid) {
|
||||||
return getRestfulAPI("https://devapi.qweather.com/v7/weather/3d?key=" + String(key) + "&location=" + String(locid), [&result](JsonDocument& json) {
|
return getRestfulAPI("https://api.qweather.com/v7/weather/3d?key=" + String(key) + "&location=" + String(locid), [&result](JsonDocument& json) {
|
||||||
if (strcmp(json["code"], "200") != 0) {
|
if (strcmp(json["code"], "200") != 0) {
|
||||||
Serial.print(F("Get daily forecast failed, error: "));
|
Serial.print(F("Get daily forecast failed, error: "));
|
||||||
Serial.println(json["code"].as<const char*>());
|
Serial.println(json["code"].as<const char*>());
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ bool getHolidays(Holiday& result, int year, int month) {
|
|||||||
}
|
}
|
||||||
http.end();
|
http.end();
|
||||||
|
|
||||||
if (int status = doc["code"]) {
|
int status = doc["code"].as<int>();
|
||||||
|
if (status != 0) {
|
||||||
Serial.println("Get holidays error.");
|
Serial.println("Get holidays error.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user