Improve logging and error handling
parent
b7e2522083
commit
08dbd792cd
|
@ -35,15 +35,15 @@ async def async_setup_platform(hass, config, async_add_entities,
|
||||||
|
|
||||||
tibber_connection = hass.data.get(TIBBER_DOMAIN)
|
tibber_connection = hass.data.get(TIBBER_DOMAIN)
|
||||||
|
|
||||||
try:
|
dev = []
|
||||||
dev = []
|
for home in tibber_connection.get_homes():
|
||||||
for home in tibber_connection.get_homes():
|
try:
|
||||||
await home.update_info()
|
await home.update_info()
|
||||||
dev.append(TibberSensorElPrice(home))
|
except (asyncio.TimeoutError, aiohttp.ClientError):
|
||||||
if home.has_real_time_consumption:
|
pass
|
||||||
dev.append(TibberSensorRT(home))
|
dev.append(TibberSensorElPrice(home))
|
||||||
except (asyncio.TimeoutError, aiohttp.ClientError):
|
if home.has_real_time_consumption:
|
||||||
raise PlatformNotReady()
|
dev.append(TibberSensorRT(home))
|
||||||
|
|
||||||
async_add_entities(dev, True)
|
async_add_entities(dev, True)
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ from homeassistant.const import (EVENT_HOMEASSISTANT_STOP, CONF_ACCESS_TOKEN,
|
||||||
from homeassistant.helpers import discovery
|
from homeassistant.helpers import discovery
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
|
|
||||||
REQUIREMENTS = ['pyTibber==0.8.2']
|
REQUIREMENTS = ['pyTibber==0.8.3']
|
||||||
|
|
||||||
DOMAIN = 'tibber'
|
DOMAIN = 'tibber'
|
||||||
|
|
||||||
|
|
|
@ -827,7 +827,7 @@ pyRFXtrx==0.23
|
||||||
pySwitchmate==0.4.4
|
pySwitchmate==0.4.4
|
||||||
|
|
||||||
# homeassistant.components.tibber
|
# homeassistant.components.tibber
|
||||||
pyTibber==0.8.2
|
pyTibber==0.8.3
|
||||||
|
|
||||||
# homeassistant.components.switch.dlink
|
# homeassistant.components.switch.dlink
|
||||||
pyW215==0.6.0
|
pyW215==0.6.0
|
||||||
|
|
Loading…
Reference in New Issue