summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Adam <_@yuv.al>2022-02-18 12:18:49 +0200
committerYuval Adam <_@yuv.al>2022-02-18 12:21:22 +0200
commitab7a5aa979bb29f4960f38e5edada9e7624efcbd (patch)
tree275841175f02764d4397ab9ec5a91a7f512b7897
parente7558cd717e170a316a9c9cd9d0a8b8e788ce23b (diff)
Support some weird binary content that returns on routine
-rw-r--r--alarmpy/alarmpy.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/alarmpy/alarmpy.py b/alarmpy/alarmpy.py
index c15619b..5d20b29 100644
--- a/alarmpy/alarmpy.py
+++ b/alarmpy/alarmpy.py
@@ -125,6 +125,10 @@ class Alarm:
# empty content means no alarms
return [], None
+ if res.content == b"\xef\xbb\xbf\r\n":
+ # some weird binary content that also means no alarms
+ return [], None
+
data = {} # To avoid warning in KeyError
try:
data = res.json()