feat: 全量同步 254 个常用的 Arduino 扩展库文件

This commit is contained in:
yczpf2019
2026-01-24 16:05:38 +08:00
parent c665ba662b
commit 397b9a23a3
6878 changed files with 2732224 additions and 1 deletions

View File

@@ -0,0 +1,47 @@
#ifndef _WEATHERNOW_H_
#define _WEATHERNOW_H_
#include <Arduino.h>
#include <ArduinoJson.h>
#if defined(ESP8266)
#include <ESP8266WiFi.h>
#elif defined(ESP32)
#include <WiFi.h>
#endif
//#define DEBUG // 调试用宏定义
// 获取当前天气信息类
class WeatherNow {
public:
WeatherNow();
void config(String userKey, String location, String unit, String language);
bool update();
String getWeatherText();
int getWeatherCode();
int getDegree();
String getLastUpdate();
String getServerCode();
private:
const char* _host = "api.seniverse.com"; // 服务器地址
String _reqUserKey; // 私钥
String _reqLocation; // 城市
String _reqUnit; // 摄氏/华氏
String _reqLanguage; // 简体中文zh-Hans/繁体中文zh-Hant/英文en
void _parseNowInfo(WiFiClient client); // 解析实时天气信息信息
String _status_response = "no_init"; // 服务器响应状态行
String _response_code = "no_init"; // 服务器响应状态码
String _now_text_str = "no_init";
int _now_code_int = 999;
int _now_temperature_int = 999;
String _last_update_str = "no_init";
};
#endif