mirror of
https://github.com/Manuel83/craftbeerpi3
synced 2026-09-19 15:59:07 +02:00
Created Custom Background Task (markdown)
@@ -0,0 +1,15 @@
|
||||
You can extend CraftBeerPi with custom background task. Below you will find a basic example where the method gets invoked every secons
|
||||
|
||||
```
|
||||
from modules import cbpi,
|
||||
|
||||
@cbpi.backgroundtask(key="my_task", interval=1)
|
||||
def my_custom_background_task():
|
||||
# YOUR CODE GOES HERE
|
||||
pass
|
||||
|
||||
```
|
||||
|
||||
@cbpi.backgroundtask Parameter
|
||||
* key = String value free to choose but must be unique in CraftBeerPi system
|
||||
* interval = float value in which interval the method is invoked. ie: 0.1 = 100ms 1=1sec
|
||||
Reference in New Issue
Block a user