From 8fdbc3ffbd3196155b73570d14990ad44af8006a Mon Sep 17 00:00:00 2001 From: Manuel83 Date: Sun, 25 Jun 2017 22:17:55 +0200 Subject: [PATCH] Created Custom Background Task (markdown) --- Custom-Background-Task.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Custom-Background-Task.md diff --git a/Custom-Background-Task.md b/Custom-Background-Task.md new file mode 100644 index 0000000..bf6f3d5 --- /dev/null +++ b/Custom-Background-Task.md @@ -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 \ No newline at end of file