Weather Station ============================================ You can download the tutorial's final sample project from this Github Page: https://github.com/myvobot/examples/tree/master/weather_station Introduction ---------------------- Let's say you are going to use the SyncSign as a fridge magnet. It will let you know the weather condition before breakfast every morning. Then you can write a Plug-in runs on Hub, which inquires the local weather at 8 am every day, then render the icon and text on the SyncSign. The Plug-in consists of these components: - Periodic HTTP Request to the Web API of weather information - Usually, the response is a JSON format result - Parse the JSON and extract the data you need (temperature, humidity, etc.) - Create a layout and send it to the SyncSign Setup ---------------------- - Sign-up a free account and obtain an API Key from [OpenWeatherMap](https://home.openweathermap.org/api_keys) - Replace the placeholder of OPENWEATHERMAP_APIKEY with your API key - Edit CITY_NAME & COUNTRY_CODE Deploy and Run the Plug-in --------------------------- Then you can deploy the code to the Hub and see what would happen. .. 假设您把XXX作为一个冰箱贴,希望每天在早餐前可以看到今天的天气情况。那么,你可以让Hub在每天早上的8点钟获取当地的天气信息,然后在display上显示一个图标和文本。根据这个场景,编写的EAPP主要由以下单元组成: .. - 定时发起一个HTTP REQUEST,获得天气信息,这通常是一个JSON格式的数据; .. - 分析天气信息,提取出需要显示的内容; .. - 创建显示描述,发送给Display显示。 .. Test .. ---------------------- .. Congratulations... Summary ---------------------- In this tutorial, you have learned how to write a Hub App with web service integration. We hope you enjoyed this tutorial, and I look forward to seeing you again!