Changes for page 05 Lua Script

Last modified by Devin Chen on 2025/03/04 14:07

From version 39.1
edited by Hunter
on 2023/07/10 14:03
Change comment: There is no comment for this version
To version 38.2
edited by Hunter
on 2023/07/10 12:01
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -301,10 +301,8 @@
301 301  
302 302  The example shows how to parse value from HTTP response body, and display into HMI internal address. The test forecast official website is [[https:~~/~~/www.weatherapi.com/>>url:https://www.weatherapi.com/]]
303 303  
304 -[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/luahttp.zip]]
304 +From the API document, the one day forecast response would be like the follows:
305 305  
306 -From the API explorer of weatherapi, the one day forecast response would be like the follows(Because the original data of JSON is very long, there we just show the part of it):
307 -
308 308  {{code language="JSON"}}
309 309  {
310 310   "location": {
... ... @@ -513,12 +513,4 @@
513 513  }
514 514  {{/code}}
515 515  
516 -The core code is from file API_WEATHER.lua, and function name is get7DayWeatherapiByCityname.
517 -
518 -(% style="text-align:center" %)
519 -[[image:WeatherHTTPAPI.png]]
520 -
521 -The HMI offline simulator result:
522 -
523 -(% style="text-align:center" %)
524 -[[image:WeatherHTTPtestdisplay.png]]
514 +[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/luahttp.zip]]
1688968905886-196.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Hunter
Size
... ... @@ -1,1 +1,0 @@
1 -26.5 KB
Content
WeatherHTTPAPI.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Hunter
Size
... ... @@ -1,1 +1,0 @@
1 -55.9 KB
Content
WeatherHTTPtestdisplay.png
Author
... ... @@ -1,1 +1,0 @@
1 -XWiki.Hunter
Size
... ... @@ -1,1 +1,0 @@
1 -36.2 KB
Content