Improve logging and error handling
This commit is contained in:
1 parent
b7e2522083
commit
08dbd792cd
3 files changed
+10
-10
No files matched your search
@@ -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