Exemplo n.º 1
0
 def close(self, event):
     log.debug("Closing LTCBackend")
     try:
         self.ignite(False)
     except PhidgetException:
         log.info("Unable to turn off ignite on quit")
     self.relay.close()
     self.core.close()
Exemplo n.º 2
0
 def close(self, event):
     log.debug("Closing LTCBackend")
     try:
         self.ignite(False)
     except PhidgetException:
         log.info("Unable to turn off ignite on quit")
     self.relay.close()
     self.core.close()
Exemplo n.º 3
0
 def __init__(self, **kwargs):
     log.debug("Acquiring InterfaceKit")
     self.ik = InterfaceKit()
     log.debug("Registering Handlers")
     self.ik.setOnAttachHandler(self._onAttach)
     self.ik.setOnDetachHandler(self._onDetach)
     self.ik.setOnErrorhandler(self._onError)
     self.ik.setOnOutputChangeHandler(self._onOutput)
     self.ik.setOnInputChangeHandler(self._onInput)
     self.ik.setOnSensorChangeHandler(self._onSensor)
Exemplo n.º 4
0
 def __init__(self, **kwargs):
     log.debug("Acquiring InterfaceKit")
     self.ik = InterfaceKit()
     log.debug("Registering Handlers")
     self.ik.setOnAttachHandler(self._onAttach)
     self.ik.setOnDetachHandler(self._onDetach)
     self.ik.setOnErrorhandler(self._onError)
     self.ik.setOnOutputChangeHandler(self._onOutput)
     self.ik.setOnInputChangeHandler(self._onInput)
     self.ik.setOnSensorChangeHandler(self._onSensor)
Exemplo n.º 5
0
 def add_callback(self, cb, type):
     log.debug("Adding callback to {} sensor".format(self.name))
     self.callback[type].append(cb)
Exemplo n.º 6
0
 def _onError(self, event):
     log.debug(event.description)
     log.verbose("{} event received".format(type))
     for cb in self.callback['error']:
         cb(event)
Exemplo n.º 7
0
 def remove_callback(self, cb, type):
     log.debug("Removing a {} type callback".format(type))
     self.callback[type].remove(cb)
Exemplo n.º 8
0
 def add_callback(self, cb, type):
     log.debug("Adding a {} type callback".format(type))
     self.callback[type].append(cb)
Exemplo n.º 9
0
 def close(self):
     log.verbose("Closing InterfaceKit")
     self.ik.closePhidget()
     log.debug("Interfac kit closed")
Exemplo n.º 10
0
 def start(self):
     log.verbose("Opening remote IP")
     self.ik.openRemoteIP(self.IP, self.port, self.devserial)
     log.debug("Remote IP opened")
Exemplo n.º 11
0
 def add_callback(self, cb, type):
     log.debug("Adding callback to {} sensor".format(self.name))
     self.callback[type].append(cb)
Exemplo n.º 12
0
 def _onError(self, event):
     log.debug(event.description)
     log.verbose("{} event received".format(type))
     for cb in self.callback['error']:
         cb(event)
Exemplo n.º 13
0
 def remove_callback(self, cb, type):
     log.debug("Removing a {} type callback".format(type))
     self.callback[type].remove(cb)
Exemplo n.º 14
0
 def add_callback(self, cb, type):
     log.debug("Adding a {} type callback".format(type))
     self.callback[type].append(cb)
Exemplo n.º 15
0
 def close(self):
     log.verbose("Closing InterfaceKit")
     self.ik.closePhidget()
     log.debug("Interfac kit closed")
Exemplo n.º 16
0
 def start(self):
     log.verbose("Opening remote IP")
     self.ik.openRemoteIP(self.IP, self.port, self.devserial)
     log.debug("Remote IP opened")