def __init__(self, abode, url=CONST.SOCKETIO_URL):
        """Init event subscription class."""
        self._abode = abode
        self._thread = None
        self._running = False

        # Setup callback dicts
        self._device_callbacks = collections.defaultdict(list)
        self._event_callbacks = collections.defaultdict(list)
        self._timeline_callbacks = collections.defaultdict(list)

        # Setup SocketIO
        self._socketio = sio.SocketIO(url=url,
                                      origin=CONST.BASE_URL)

        # Setup SocketIO Callbacks
        self._socketio.on(sio.STARTED, self._on_socket_started)
        self._socketio.on(sio.CONNECTED, self._on_socket_connected)
        self._socketio.on(CONST.DEVICE_UPDATE_EVENT, self._on_device_update)
        self._socketio.on(CONST.GATEWAY_MODE_EVENT, self._on_mode_change)
        self._socketio.on(CONST.TIMELINE_EVENT, self._on_timeline_update)
        self._socketio.on(CONST.AUTOMATION_EVENT, self._on_automation_update)
def __init__ ( self , abode , url = CONST . SOCKETIO_URL ) : self . _abode = abode self . _thread = None self . _running = False self . _device_callbacks = collections . defaultdict ( list ) self . _event_callbacks = collections . defaultdict ( list ) self . _timeline_callbacks = collections . defaultdict ( list ) self . _socketio = sio . SocketIO ( url = url , origin = CONST . BASE_URL ) self . _socketio . on ( sio . STARTED , self . _on_socket_started ) self . _socketio . on ( sio . CONNECTED , self . _on_socket_connected ) self . _socketio . on ( CONST . DEVICE_UPDATE_EVENT , self . _on_device_update ) self . _socketio . on ( CONST . GATEWAY_MODE_EVENT , self . _on_mode_change ) self . _socketio . on ( CONST . TIMELINE_EVENT , self . _on_timeline_update ) self . _socketio . on ( CONST . AUTOMATION_EVENT , self . _on_automation_update )
Init event subscription class.