From e03e395c8d1a76019c68192bea5ec6223347d08b Mon Sep 17 00:00:00 2001 From: Justin Schembri Date: Sun, 6 Apr 2025 09:54:25 +0200 Subject: [PATCH] raises error when no response received --- lnetatmo.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lnetatmo.py b/lnetatmo.py index b2ea9d39..4bd354c0 100644 --- a/lnetatmo.py +++ b/lnetatmo.py @@ -484,6 +484,8 @@ def __init__(self, authData, home=None, station=None): "access_token" : self.getAuthToken } resp = postRequest("Weather station", _GETSTATIONDATA_REQ, postParams) + if not resp: + raise AuthFailure("No response received from server.") self.rawData = resp['body']['devices'] # Weather data if not self.rawData : raise NoDevice("No weather station in any homes")