diff options
author | Edi Feschiyan <edi.feschiyan@konsulko.com> | 2020-03-12 18:38:18 +0200 |
---|---|---|
committer | Edi Feschiyan <edi.feschiyan@konsulko.com> | 2020-03-12 18:38:18 +0200 |
commit | 1cd18d024c69369a6e502db4cd1d1acddf1e0958 (patch) | |
tree | d205e82ec918f080e05cba5b00a48ee01132cf01 /aglbaseservice.py | |
parent | ba673345466a365adb107a32dc4143390d4032eb (diff) |
fixed wrong argument in websocket - sending string instead int in json for aglbaseservice
Diffstat (limited to 'aglbaseservice.py')
-rw-r--r-- | aglbaseservice.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/aglbaseservice.py b/aglbaseservice.py index f97402b..972b6bb 100644 --- a/aglbaseservice.py +++ b/aglbaseservice.py @@ -6,8 +6,7 @@ import sys import asyncio from random import randint from websockets import connect -from os import environ -from argparse import ArgumentParser + # IPADDR = '127.0.0.1' @@ -93,10 +92,12 @@ class AGLBaseService: print("Received keyboard interrupt, exiting") except asyncio.CancelledError: print("Websocket listener coroutine stopped") + except Exception as e: + print("vote du phoque?!?!? : " + str(e)) async def subscribe(self, event): msgid = randint(0, 999999) - msg = f'["{AFBT.REQUEST}","{msgid}","{self.api}/subscribe",{{"value": "{event}"}}]' + msg = f'[{AFBT.REQUEST},"{msgid}","{self.api}/subscribe",{{"value": "{event}"}}]' await self.send(msg) async def unsubscribe(self, event): |