Пример #1
0
 def __init__(self, api, key, src, interval):
     Daemon.__init__(self, '/tmp/pachudaemon.pid', stdout='/tmp/pachudaemon.out', stderr='/tmp/pachudaemon.out')
     self._api = api
     self._key = key
     self._src = Serial(src, 9600)
     self._tempnum = self._humnum = self._temp =  self._hum = 0.0
     self._lastput = datetime.now()
     self._updateinterval = timedelta(minutes=interval)
     self._pachube = Pachube(self._api, self._key)
Пример #2
0
 def __init__(self, pidfile, stdout):
     Daemon.__init__(self, pidfile, stdout=stdout, stderr=stdout)
     self._source = serial.Serial('/dev/ttyUSB0', 9600)
     self._temperature = '/tmp/temperature.rrd'