From d9a8111adf92d85c0645a614a1bf7f04faf84880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20W=C3=BCrbach?= Date: Thu, 20 Dec 2018 13:32:54 +0100 Subject: [PATCH] Test re-init on invalid auth Somehow the connection is lost after some days, try to re-init. --- modules/HomematicIP.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/HomematicIP.py b/modules/HomematicIP.py index 3c158f8..20184f9 100644 --- a/modules/HomematicIP.py +++ b/modules/HomematicIP.py @@ -34,6 +34,9 @@ def getdata(): global h if not h.get_current_state(): + # Re-init to prevent stale access tokens + h.init(config["accesspointid"]) + if not h.get_current_state(): if not h.get_current_state(): return