Fix README

This commit is contained in:
Evgeny
2023-07-15 16:57:11 +04:00
parent 081d8c41a1
commit cdb9b7aec6

168
README.md
View File

@@ -74,27 +74,19 @@ With side menu scripts, you can display your own list in the menu. The script ca
The script starts with the following function: The script starts with the following function:
``` `on_drawer_open()`
on_drawer_open()
```
In this function, you must prepare a list and display it using one of the following functions: In this function, you must prepare a list and display it using one of the following functions:
``` * `drawer:show_list(lines, [icons], [badges], [show_alphabet])` - shows lines, optionally you can specify a table of icons (in `fa:icon_name` format), a table of lines to be displayed in badges and pass a boolean value: whether to show the alphabet;
* ``drawer:show_list(lines, [icons], [badges], [show_alphabet])`` - shows lines, optionally you can specify a table of icons (in `fa:icon_name` format), a table of lines to be displayed in badges and pass a boolean value: whether to show the alphabet; * `drawer:show_ext_lines(lines, [max_lines)` - shows multiline lines, optionally you can specify the maximum number of lines of each element (default is 5).
* ``drawer:show_ext_lines(lines, [max_lines)`` - shows multiline lines, optionally you can specify the maximum number of lines of each element (default is 5).
```
The following functions are also available: The following functions are also available:
``` * `drawer:add_buttons(icons, default_index)` - shows icons at the bottom of the menu (in `fa:icon_name` format), `default_index` is the index of the selected icon;
* ``drawer:add_buttons(icons, default_index)`` - shows icons at the bottom of the menu (in `fa:icon_name` format), `default_index` is the index of the selected icon;
* `drawer:clear()` - clears the list; * `drawer:clear()` - clears the list;
* `drawer:close()` - closes the menu; * `drawer:close()` - closes the menu;
* `drawer:change_view(name)` - switches the menu to another script or display style (argument: either script file name, `sortable` or `categories`). * `drawer:change_view(name)` - switches the menu to another script or display style (argument: either script file name, `sortable` or `categories`).
```
Clicking on list items will call `on_click(index)`, long-clicking will call `on_long_click(index)`, clicking a bottom icon will call `on_button_click(index)`. Clicking on list items will call `on_click(index)`, long-clicking will call `on_long_click(index)`, clicking a bottom icon will call `on_button_click(index)`.
@@ -297,26 +289,30 @@ Intent table format (all fields are optional):
Format of table elements returned by `aio:available_widgets()`: Format of table elements returned by `aio:available_widgets()`:
* `name` - internal name of the widget; ```
* `label` - title of the widget; `name` - internal name of the widget;
* `type` - widget type: `builtin`, `script` or `plugin`; `label` - title of the widget;
* `description` - widget description (usually empty for non-script widgets); `type` - widget type: `builtin`, `script` or `plugin`;
* `clonable` - true if the widget can have clones (examples: "My apps", "Contacts", "Mailbox" widgets); `description` - widget description (usually empty for non-script widgets);
* `enabled` - true if the widget is placed on the screen. `clonable` - true if the widget can have clones (examples: "My apps", "Contacts", "Mailbox" widgets);
`enabled` - true if the widget is placed on the screen.
```
Format of table elements returned by `aio:active_widgets()`: Format of table elements returned by `aio:active_widgets()`:
* `name` - internal name of the widget; ```
* `label` - widget visible name; `name` - internal name of the widget;
* `position` - position on the screen; `label` - widget visible name;
* `folded` - true if widget is folded. `position` - position on the screen;
`folded` - true if widget is folded.
```
Format of table elements returned by `aio:actions()`: Format of table elements returned by `aio:actions()`:
``` ```
* `name` - action name; `name` - action name;
* `short_name` - action short name; `short_name` - action short name;
* `label` - action name visible to the user. `label` - action name visible to the user.
``` ```
To accept a value sent by the `send_message` function, the receiving script must implement a callback `on_message(value)`. To accept a value sent by the `send_message` function, the receiving script must implement a callback `on_message(value)`.
@@ -353,11 +349,11 @@ end
The format of the category table: The format of the category table:
``` ```
* `id` - category id (id above 1000 are custom categories); `id` - category id (id above 1000 are custom categories);
* `name` - category name; `name` - category name;
* `icon` - category icon; `icon` - category icon;
* `color` - category color; `color` - category color;
* `hidden` - the category is hidden by the user. `hidden` - the category is hidden by the user.
``` ```
Sorting options: Sorting options:
@@ -395,22 +391,26 @@ If there is a problem with the network, the `on_network_error_$id` callback will
Event table format: Event table format:
* `id` - event ID; ```
* `calendar_id` - calendar ID; `id` - event ID;
* `title` - title of the event; `calendar_id` - calendar ID;
* `description` - description of the event; `title` - title of the event;
* `color` - color of the event; `description` - description of the event;
* `status` - status string of the event or empty; `color` - color of the event;
* `location` - address of the event by string; `status` - status string of the event or empty;
* `begin` - start time of the event (in seconds); `location` - address of the event by string;
* `end` - time of the event end (in seconds); `begin` - start time of the event (in seconds);
* `all_day` - boolean value, which means that the event lasts all day. `end` - time of the event end (in seconds);
`all_day` - boolean value, which means that the event lasts all day.
```
Calendar table format: Calendar table format:
* `id` - calendar identifier; ```
* `name` - name of the calendar; `id` - calendar identifier;
* `color` - color of the calendar in the format #XXXXXXXX. `name` - name of the calendar;
`color` - color of the calendar in the format #XXXXXXXX.
```
## Phone ## Phone
@@ -423,10 +423,12 @@ Calendar table format:
Contacts table format: Contacts table format:
* `id` - contact id; ```
* `lookup_key` - unique contact identifier; `id` - contact id;
* `name` - contact name; `lookup_key` - unique contact identifier;
* `number` - contact number. `name` - contact name;
`number` - contact number.
```
## Tasks ## Tasks
@@ -442,14 +444,16 @@ Once the tasks are loaded, the `on_tasks_loaded()` function will be executed.
The format of the task table: The format of the task table:
* `id` - task ID; ```
* `text` - text; `id` - task ID;
* `date` - date of creation; `text` - text;
* `due_date` - deadline; `date` - date of creation;
* `completed_date` - task completion date; `due_date` - deadline;
* `high_priority` - flag of high priority; `completed_date` - task completion date;
* `notification` - flag of notification display; `high_priority` - flag of high priority;
* `is_today` - is it today's task? `notification` - flag of notification display;
`is_today` - is it today's task?
```
## Notes ## Notes
@@ -466,10 +470,12 @@ Once the notes are loaded, the `on_notes_loaded()` function will be executed.
The format of the note table: The format of the note table:
* `id` - note ID; ```
* `text` - text; `id` - note ID;
* `color` - note color ID; `text` - text;
* `position` - note position on the screen. `color` - note color ID;
`position` - note position on the screen.
```
## Weather ## Weather
@@ -479,12 +485,14 @@ _Avaialble from: 4.1.0_
Function returns the weather data in the `on_weather_result(result)` callback, where `result` is a table of tables with the following fields: 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; `time` - time in seconds;
* `icon_code` - code of weather icon; `temp` - temperature;
* `humidity` - humidity; `icon_code` - code of weather icon;
* `wind_speed` - wind speed; `humidity` - humidity;
* `wind_direction` - wind direction. `wind_speed` - wind speed;
`wind_direction` - wind direction.
```
## Cloud ## Cloud
@@ -514,20 +522,22 @@ The `notify:request_current()` function asks for all current notifications. The
Notification table format: Notification table format:
* `key` - a key uniquely identifying the notification; ```
* `time` - time of notification publication in seconds; `key` - a key uniquely identifying the notification;
* `package` - name of the application package that sent the notification; `time` - time of notification publication in seconds;
* `number` - the number on the notification badge, if any; `package` - name of the application package that sent the notification;
* `importance` - notification importance level: from 1 (low) to 4 (high), 3 - standard; `number` - the number on the notification badge, if any;
* `category` - notification category, for example `email`; `importance` - notification importance level: from 1 (low) to 4 (high), 3 - standard;
* `title` - notification title; `category` - notification category, for example `email`;
* `text` - notification text; `title` - notification title;
* `sub_text` - additional notification text; `text` - notification text;
* `big_text` - extended notification text; `sub_text` - additional notification text;
* `is_clearable` - true, if the notification is clearable; `big_text` - extended notification text;
* `group_id` - notification group ID; `is_clearable` - true, if the notification is clearable;
* `messages` - table of tables with fields: `sender`, `text`, `time` (_available from: 4.1.5_); `group_id` - notification group ID;
* `actions` - table notifications actions with fields: `id`, `title`, `have_input` (_available from: 4.1.5_); `messages` - table of tables with fields: `sender`, `text`, `time` (_available from: 4.1.5_);
`actions` - table notifications actions with fields: `id`, `title`, `have_input` (_available from: 4.1.5_);
```
Keep in mind that the AIO Launcher also calls `request_current()` every time you return to the launcher, which means that all scripts will also get notification information in the `on_notify_posted()` callback every time you return to the desktop. Keep in mind that the AIO Launcher also calls `request_current()` every time you return to the launcher, which means that all scripts will also get notification information in the `on_notify_posted()` callback every time you return to the desktop.