Source code for BAC0.tasks.DoOnce
# -*- coding: utf-8 -*-
# Copyright (C) 2015 by Christian Tremblay, P.Eng <firstname.lastname@example.org>
# Licensed under LGPLv3, see file LICENSE in this source tree.
DoOnce.py - execute a task once
from .TaskManager import OneShotTask
from ..core.utils.notes import note_and_log
Start a polling task which is in fact a recurring read of the point.
def __init__(self, fnc):
:param point: (BAC0.core.device.Points.Point) name of the point to read
:param delay: (int) Delay between reads in seconds, defaults = 10sec
A delay cannot be < 5sec (there are risks of overloading the device)
if hasattr(fnc, "__call__"):
self.func = fnc
raise ValueError("You must pass a function to this...")
[docs] def task(self):