From f46e992bda7be37ebb2041e67fb05d1ea5379709 Mon Sep 17 00:00:00 2001 From: Ben Arc Date: Thu, 15 Apr 2021 09:46:37 +0100 Subject: [PATCH] Stupid string bug --- lnbits/extensions/copilot/views_api.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lnbits/extensions/copilot/views_api.py b/lnbits/extensions/copilot/views_api.py index d45aec7e..4324e1ec 100644 --- a/lnbits/extensions/copilot/views_api.py +++ b/lnbits/extensions/copilot/views_api.py @@ -31,9 +31,9 @@ from .crud import ( "animation1": {"type": "string", "required": False}, "animation2": {"type": "string", "required": False}, "animation3": {"type": "string", "required": False}, - "animation1threshold": {"type": "integer", "required": False}, - "animation2threshold": {"type": "integer", "required": False}, - "animation3threshold": {"type": "integer", "required": False}, + "animation1threshold": {"type": "string", "required": False}, + "animation2threshold": {"type": "string", "required": False}, + "animation3threshold": {"type": "string", "required": False}, "animation1webhook": {"type": "string", "required": False}, "animation2webhook": {"type": "string", "required": False}, "animation3webhook": {"type": "string", "required": False}, @@ -109,11 +109,11 @@ async def api_copilot_hooker(copilot_id, trigger): return jsonify({"message": "Copilot link link does not exist."}), HTTPStatus.NOT_FOUND socket_sendererer = app.socket_sendererer() - if copilot.animation1threshold and g.data['amount'] > copilot.animation1threshold: + if copilot.animation1threshold and int(g.data['amount']) > copilot.animation1threshold: data = copilot.animation1 - if copilot.animation2threshold and g.data['amount'] > copilot.animation2threshold: + if copilot.animation2threshold and int(g.data['amount']) > copilot.animation2threshold: data = copilot.animation2 - if copilot.animation3threshold and g.data['amount'] > copilot.animation3threshold: + if copilot.animation3threshold and int(g.data['amount']) > copilot.animation3threshold: data = copilot.animation3 async with socket_sendererer.websocket('/ws/compose/' + copilot_id) as the_websocket: await the_websocket.send(data)