Skip to content

Commit

Permalink
updated to 8k for larger qolsys installs
Browse files Browse the repository at this point in the history
  • Loading branch information
roopesh committed Apr 11, 2021
1 parent 16e26fb commit cdfc76c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions apps/ad-qolsys/qolsys_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ def create_socket(self, hostname, port, token, cb: callable, timeout=60):

self.app.log("Starting listener thread", level="INFO")
self._start_listener()
#self.listening_thread = threading.Thread(target=self.listen, args=([cb]))
#self.listening_thread.start()
self.app.log("started listener", level="INFO")

return True
Expand Down Expand Up @@ -107,19 +105,18 @@ def listen(self, cb: callable):
time.sleep(1)
try:
while self._wrappedSocket._connected and self.__listening__:
data = self._wrappedSocket.recv(4096).decode()
data = self._wrappedSocket.recv(8192).decode()
if len(data) > 0:
self.app.log("data received from qolsys panel: %s len(data): %s", data, len(data), level="DEBUG")
if is_json(data):
try:
cb(data)
except:
self.app.log("Error calling callback: %s", cb, sys.exc_info(), level="ERROR")
#print(data)
else:
if data != 'ACK\n':
pass
#self.app.log(("non json data:", data))
self.app.log("non json data: %s", data, level="DEBUG")
else:
self.app.log("No data received. Bad token? Detatching.", level="ERROR")
self._wrappedSocket.detach()
Expand Down

0 comments on commit cdfc76c

Please sign in to comment.