mirror of
https://github.com/elisspace/core.git
synced 2026-10-01 06:49:55 +00:00
Improve logging and error handling
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user