add weather info to the README

This commit is contained in:
Evgeny
2021-10-15 14:06:35 +03:00
parent 494e34fde6
commit ea6a7c63e2
2 changed files with 36 additions and 0 deletions

View File

@@ -4,6 +4,11 @@ Starting from version 4.0, AIO Launcher supports scripts, or rather special widg
The possibilities of scripts are limited, but they can be used to expand the functionality of the application almost limitlessly (see examples in this repository).
# Changelog
* 4.0.0 - first version with scripts support;
* 4.1.0 - added `weather` and `cloud` modules;
# Lifecycle callbacks
The work of any script begins with one of the three described functions. Main work should be done in one of them.
@@ -167,6 +172,19 @@ Contacts table format:
* `name` - contact name;
* `number` - contact number.
# Weather
* `weather:get_by_hour()` - performs hourly weather query.
Function returns the weather data in the `on_weather_result(result)` callback, where `result` is a table of tables with the following fields:
* `time` - time in seconds;
* `temp` - temperature;
* `icon_code` - code of weather icon;
* `humidity` - humidity;
* `wind_speed` - wind speed;
* `wind_direction` - wind direction.
# Settings
* `settings:get()` - returns the settings table in an array of words format;

View File

@@ -4,6 +4,11 @@
Возможности скриптов ограничены, но с их помощью можно практически безгранично расширять функциональность приложения (посмотрите примеры в этом репозитории).
# Изменения
* 4.0.0 - первая версия с поддержкой скриптов;
* 4.1.0 - добавлены модули `weather` и `cloud`;
# Функции (колбеки) жизненного цикла
Работа любого скрипта-виджета начинается с одной из трех описанных функций. Именно внутри них следует выполнять основную работу и выводить на экран данные.
@@ -167,6 +172,19 @@ ui:show_context_menu({
* `name` - имя контакта;
* `number` - номер контакта.
# Погода
* `weather:get_by_hour()` - выполняет запрос почасовой погоды.
Функция возвращает данные о погоде в колбеке `on_weather_result(result)`, где `result` - это таблица таблиц со следующими полями:
* `time` - время в секундах;
* `temp` - температура;
* `icon_code` - код иконки погоды;
* `humidity` - влажность;
* `wind_speed` - скорость ветра;
* `wind_direction` - направление ветра.
# Настройки
* `settings:get()` - возвращает таблицу настроек в формате массива слов;