Update README.md
This commit is contained in:
@@ -114,21 +114,7 @@ mosquitto_pub -h localhost -t 'mithermometer/update_interval' -m '30'
|
|||||||
|
|
||||||
## Custom worker development
|
## Custom worker development
|
||||||
|
|
||||||
Create custom worker in workers directory. Add config to the example config:
|
Create custom worker in workers directory.
|
||||||
|
|
||||||
### Example config entry
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
timeworker:
|
|
||||||
args:
|
|
||||||
topic_prefix: cool_time_worker
|
|
||||||
update_interval: 1800
|
|
||||||
```
|
|
||||||
|
|
||||||
Variables set in args section will be set as object attributes in [BaseWorker.__init__](https://github.com/zewelor/bt-mqtt-gateway/blob/master/workers/base.py#L2)
|
|
||||||
|
|
||||||
topic_prefix, if specified, will be added to each mqtt message. Alongside with global_prefix set for gateway
|
|
||||||
|
|
||||||
|
|
||||||
### Example simple worker
|
### Example simple worker
|
||||||
|
|
||||||
@@ -154,6 +140,21 @@ class TimeWorker(BaseWorker):
|
|||||||
|
|
||||||
`status_update` method - It will be called using specified update_interval
|
`status_update` method - It will be called using specified update_interval
|
||||||
|
|
||||||
|
Add config to the example config:
|
||||||
|
|
||||||
|
### Example config entry
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
timeworker:
|
||||||
|
args:
|
||||||
|
topic_prefix: cool_time_worker
|
||||||
|
update_interval: 1800
|
||||||
|
```
|
||||||
|
|
||||||
|
Variables set in args section will be set as object attributes in [BaseWorker.__init__](https://github.com/zewelor/bt-mqtt-gateway/blob/master/workers/base.py#L2)
|
||||||
|
|
||||||
|
topic_prefix, if specified, will be added to each mqtt message. Alongside with global_prefix set for gateway
|
||||||
|
|
||||||
## Built With
|
## Built With
|
||||||
|
|
||||||
* [Python](https://www.python.org/) - The high-level programming language for general-purpose programming
|
* [Python](https://www.python.org/) - The high-level programming language for general-purpose programming
|
||||||
|
|||||||
Reference in New Issue
Block a user