def __init__(self): logger.debug('Starting Envisalink Client') # Register events for alarmserver requests -> envisalink events.register('alarm_update', self.request_action) # Register events for envisalink proxy events.register('envisalink', self.envisalink_proxy) # Create TCP Client self.tcpclient = TCPClient() # Connection self._connection = None # Set our terminator to \r\n self._terminator = b"\r\n" # Reconnect delay self._retrydelay = 10 # Connect to Envisalink self.do_connect() # Setup timer to refresh envisalink tornado.ioloop.PeriodicCallback(self.check_connection, 1000).start() # Last activity self._last_activity = time.time()
def __init__(self, io_loop=None, ssl_options=None, **kwargs): TCPServer.__init__(self, io_loop=io_loop, ssl_options=ssl_options, **kwargs) self.connections = {} events.register('proxy', self.proxy_event)
def __init__(self): logger.debug('Starting Smartthings Client') # Register events for alarmserver requests -> envisalink #events.register('alarm_update', self.request_action) # Register events for envisalink proxy events.register('alarm', self.callbackurl_event) self.do_setup()
def __init__(self): logger.debug('Starting Envisalink Client') # Register events for alarmserver requests -> envisalink events.register('alarm_update', self.request_action) # Register events for envisalink proxy events.register('envisalink', self.envisalink_proxy) # Create TCP Client self.tcpclient = TCPClient() # Connection self._connection = None # Set our terminator to \r\n self._terminator = b"\r\n" # Reconnect delay self._retrydelay = 10 self.do_connect()
def init(): state.state = {} events.register('alarm', state.update)