def _on_client_connect(self, data):
        """Handle client connect."""
        client = None
        if data.get('id') in self._clients:
            client = self._clients[data.get('id')]
            client.update_connected(True)
        else:
            client = Snapclient(self, data.get('client'))
            self._clients[data.get('id')] = client
            if self._new_client_callback_func and callable(self._new_client_callback_func):
                self._new_client_callback_func(client)
        _LOGGER.info('client %s connected', client.friendly_name)
def _on_client_connect ( self , data ) : client = None if data . get ( 'id' ) in self . _clients : client = self . _clients [ data . get ( 'id' ) ] client . update_connected ( True ) else : client = Snapclient ( self , data . get ( 'client' ) ) self . _clients [ data . get ( 'id' ) ] = client if self . _new_client_callback_func and callable ( self . _new_client_callback_func ) : self . _new_client_callback_func ( client ) _LOGGER . info ( 'client %s connected' , client . friendly_name )
Handle client connect.