Skip to content

Commit

Permalink
Add auto-relogin after a command failed #30
Browse files Browse the repository at this point in the history
- Happens when the same vimar user logged in from somewhere else
  • Loading branch information
h4de5 committed Jun 1, 2021
1 parent f1baf02 commit 39edd62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/vimar/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"dependencies": [],
"config_flow": false,
"codeowners": ["@h4de5"],
"version": "2021.5.3",
"version": "2021.5.4",
"iot_class": "local_polling"
}
4 changes: 4 additions & 0 deletions custom_components/vimar/vimarlink/vimarlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ def _parse_sql_payload(self, string):
# exc_type, exc_obj, exc_tb = sys.exc_info()
_, _, exc_tb = sys.exc_info()
_LOGGER.error("Error parsing SQL: %s in line: %d - payload: %s" % (err, exc_tb.tb_lineno, string))
# enforce relogin
_LOGGER.info("Start to relogin..")
VimarLink._session_id = None
self.login()
# raise VimarConnectionError(
# "Error parsing SQL: %s in line: %d - payload: %s" % (err, exc_tb.tb_lineno, string))

Expand Down

0 comments on commit 39edd62

Please sign in to comment.