Description
Interface version
Version number |
Writer |
Date |
Description |
1.0 |
Xie Yicheng |
December 14, 2020 |
Initial version |
IP address
http:
API list
Name |
Description |
get_weather |
get information about weather |
get_time |
get information about time |
1. get_weather
Request parameter description
Parameter name |
Type |
Description |
weather_msg |
string |
weather information |
Call sample
- ubus command:
ubus call weather get_weather '{"weather":"datas[0]"}'
- wapi command:
wapi 8ms '{"ver": "1.0", "module": "weather", "api": "get_weather", "param": {"weather": "datas[0]"}}'
Return sample
{
"city": "Shenzhen",
"datas[0].air": "good",
"datas[0].date": "January 04, 2021",
"datas[0].wea": "cloudy",
"datas[0].weaImg": "yin",
"datas[0].weekDesc": "Monday",
"datas[0].wendu": "16~21°C",
"datas[0].wet": "38"
}
Return parameter description
Parameter name |
Type |
Description |
weather_msg |
string |
weather information |
Error code
2、get_time
Request parameter description
Parameter name |
Type |
Description |
time_msg |
string |
time information |
Call sample
- ubus command:
ubus call weather get_time '{"time":"time"}'
- wapi command:
wapi 8ms '{"ver": "1.0", "module": "weather", "api": "get_time", "param": {"get_time": "time"}}'
Return sample
{
"year": 2021,
"month": 1,
"day": 4,
"hour": 16,
"minute": 29,
"second": 34
}
Return parameter description
Parameter name |
Type |
Description |
year |
int |
year |
month |
int |
month |
day |
int |
day |
hour |
int |
hour |
minute |
int |
minute |
second |
int |
second |
Error code
文档更新时间: 2021-06-02 15:15 作者:plj