Description

  • Weather API

Interface version

Version number Writer Date Description
1.0 Xie Yicheng December 14, 2020 Initial version

IP address

http://192.168.1.1

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

  1. ubus command:
ubus call weather get_weather '{"weather":"datas[0]"}'
  1. 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

error code Description

2、get_time

Request parameter description

Parameter name Type Description
time_msg string time information

Call sample

  1. ubus command:
ubus call weather get_time '{"time":"time"}'
  1. 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

Error code Description
文档更新时间: 2021-06-02 15:15   作者:plj