Skip to content

Commit 2066576

Browse files
committed
readme: update description of tasks and commands
1 parent 74e4e86 commit 2066576

1 file changed

Lines changed: 12 additions & 11 deletions

File tree

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ Checkout [examples](examples).
3030

3131
### Device Telemetry and Properties
3232

33-
Every method of `enapter.vucm.Device` subclass with a name that starts with
34-
`task_` prefix is considered a _device task_. When such a device is started,
35-
all of its tasks are started as well. Device tasks are started in random order
36-
and are being executed concurrently in the background. If a device task returns
37-
or raises an exception, device routine is terminated. A typical use of the task
38-
is to run a periodic job to send device telemetry and properties.
33+
Every method of `enapter.vucm.Device` subclass decorated with
34+
`enapter.vucm.device_task` decorator is considered a _device task_. When such a
35+
device is started, all of its tasks are started as well. Device tasks are
36+
started in random order and are being executed concurrently in the background.
37+
If a device task returns or raises an exception, device routine is terminated.
38+
A typical use of the task is to run a periodic job to send device telemetry and
39+
properties.
3940

4041
In order to send telemetry and properties define two corresponding device
4142
tasks. It is advised (but is not obligatory) to send telemetry every **1
@@ -45,12 +46,12 @@ Examples:
4546

4647
- [wttr-in](examples/vucm/wttr-in)
4748

48-
### Device Commands
49+
### Device Command Handlers
4950

50-
Every method of `enapter.vucm.Device` subclass with a name that starts with
51-
`cmd_` prefix is considered a _device command handler_. Device command handlers
52-
receive the same arguments as described in device Blueprint manifest and can
53-
optionally return a payload as `dict`.
51+
Every method of `enapter.vucm.Device` subclass decorated with
52+
`enapter.vucm.device_command` is considered a _device command handler_. Device
53+
command handlers receive the same arguments as described in device Blueprint
54+
manifest and can optionally return a payload as `enapter.types.JSON`.
5455

5556
In order to handle device commands define corresponding device command
5657
handlers.

0 commit comments

Comments
 (0)