Improve logging and error handling
This commit is contained in:
parent
b7e2522083
commit
08dbd792cd
3 changed files with 10 additions and 10 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue