From 08dbd792cdcd3d56123e1734039fdb68fe5d4149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Sun, 2 Dec 2018 15:35:59 +0100 Subject: [PATCH] Improve logging and error handling --- homeassistant/components/sensor/tibber.py | 16 ++++++++-------- homeassistant/components/tibber/__init__.py | 2 +- requirements_all.txt | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/sensor/tibber.py b/homeassistant/components/sensor/tibber.py index 997ecdd4c3d..245c98a76f0 100644 --- a/homeassistant/components/sensor/tibber.py +++ b/homeassistant/components/sensor/tibber.py @@ -35,15 +35,15 @@ async def async_setup_platform(hass, config, async_add_entities, tibber_connection = hass.data.get(TIBBER_DOMAIN) - try: - dev = [] - for home in tibber_connection.get_homes(): + dev = [] + for home in tibber_connection.get_homes(): + try: await home.update_info() - dev.append(TibberSensorElPrice(home)) - if home.has_real_time_consumption: - dev.append(TibberSensorRT(home)) - except (asyncio.TimeoutError, aiohttp.ClientError): - raise PlatformNotReady() + except (asyncio.TimeoutError, aiohttp.ClientError): + pass + dev.append(TibberSensorElPrice(home)) + if home.has_real_time_consumption: + dev.append(TibberSensorRT(home)) async_add_entities(dev, True) diff --git a/homeassistant/components/tibber/__init__.py b/homeassistant/components/tibber/__init__.py index 2545417e033..4f6761f0b40 100644 --- a/homeassistant/components/tibber/__init__.py +++ b/homeassistant/components/tibber/__init__.py @@ -16,7 +16,7 @@ from homeassistant.const import (EVENT_HOMEASSISTANT_STOP, CONF_ACCESS_TOKEN, from homeassistant.helpers import discovery from homeassistant.helpers.aiohttp_client import async_get_clientsession -REQUIREMENTS = ['pyTibber==0.8.2'] +REQUIREMENTS = ['pyTibber==0.8.3'] DOMAIN = 'tibber' diff --git a/requirements_all.txt b/requirements_all.txt index 5f439e0dd07..06b49b6d514 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -827,7 +827,7 @@ pyRFXtrx==0.23 pySwitchmate==0.4.4 # homeassistant.components.tibber -pyTibber==0.8.2 +pyTibber==0.8.3 # homeassistant.components.switch.dlink pyW215==0.6.0