Changes for page 05 Lua Script

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

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

Summary

Details

Page properties
Content
... ... @@ -301,8 +301,10 @@
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 -From the API document, the one day forecast response would be like the follows:
304 +[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/luahttp.zip]]
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 +
306 306  {{code language="JSON"}}
307 307  {
308 308   "location": {
... ... @@ -511,4 +511,12 @@
511 511  }
512 512  {{/code}}
513 513  
514 -[[Download link>>https://ftp.we-con.com.cn/Download/WIKI/PI%20HMI/Demo/Lua%20Script/luahttp.zip]]
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]]
1688968905886-196.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Hunter
Size
... ... @@ -1,0 +1,1 @@
1 +26.5 KB
Content
WeatherHTTPAPI.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Hunter
Size
... ... @@ -1,0 +1,1 @@
1 +55.9 KB
Content
WeatherHTTPtestdisplay.png
Author
... ... @@ -1,0 +1,1 @@
1 +XWiki.Hunter
Size
... ... @@ -1,0 +1,1 @@
1 +36.2 KB
Content