From ff367aeb3feaf809690171ed06c017a23c04d6e4 Mon Sep 17 00:00:00 2001 From: pvizeli Date: Wed, 29 Mar 2017 17:08:16 +0200 Subject: [PATCH] Fix version fetch --- hassio_api/hassio/tools.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hassio_api/hassio/tools.py b/hassio_api/hassio/tools.py index 238bd1c33..f6a9b64ab 100644 --- a/hassio_api/hassio/tools.py +++ b/hassio_api/hassio/tools.py @@ -2,6 +2,7 @@ import logging import re +import aiohttp import async_timeout from .const import URL_HASSIO_VERSION @@ -16,9 +17,10 @@ async def fetch_current_versions(websession): try: with async_timeout.timeout(10, loop=websession.loop): async with websession.get(URL_HASSIO_VERSION) as request: - return await request.json() + data = await request.text() + return json.loads(data) - except Exception as err: # pylint: disable=broad-except + except (ValueError, aiohttp.ClientError, asyncio.TimeoutError) as err: _LOGGER.warning("Can't fetch versions from github! %s", err)