mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 14:17:45 +00:00
Improve Sky Hub error handling (#5762)
* Added error handling in function _get_skyhub_data * Error line split for readability
This commit is contained in:
parent
48161697f8
commit
86da4f511d
@ -111,6 +111,9 @@ def _get_skyhub_data(url):
|
|||||||
def _parse_skyhub_response(data_str):
|
def _parse_skyhub_response(data_str):
|
||||||
"""Parse the Sky Hub data format."""
|
"""Parse the Sky Hub data format."""
|
||||||
pattmatch = re.search('attach_dev = \'(.*)\'', data_str)
|
pattmatch = re.search('attach_dev = \'(.*)\'', data_str)
|
||||||
|
if pattmatch is None:
|
||||||
|
raise IOError('Error: Impossible to fetch data from' +
|
||||||
|
' Sky Hub. Try to reboot the rooter.')
|
||||||
patt = pattmatch.group(1)
|
patt = pattmatch.group(1)
|
||||||
|
|
||||||
dev = [patt1.split(',') for patt1 in patt.split('<lf>')]
|
dev = [patt1.split(',') for patt1 in patt.split('<lf>')]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user