def ping(server): client = LepDClient(server=server) data = {} data['connected'] = client.ping() return jsonify(data)
def ping_lepd_server(request): server = request['server'] print('received ping: ' + server) client = LepDClient(server=server) ping_result = client.ping() if ping_result: emit('lepd.ping.succeeded', {}) else: emit('lepd.ping.failed', {})