Fixed unhandled exception in OpenUV data update (#23611)

This commit is contained in:
Aaron Bach
2019-05-01 21:15:10 -06:00
committed by GitHub
parent f0c582ebbd
commit 75abfd49ef

View File

@@ -162,7 +162,13 @@ async def async_setup_entry(hass, config_entry):
async def update_data(service): async def update_data(service):
"""Refresh OpenUV data.""" """Refresh OpenUV data."""
_LOGGER.debug('Refreshing OpenUV data') _LOGGER.debug('Refreshing OpenUV data')
await openuv.async_update()
try:
await openuv.async_update()
except OpenUvError as err:
_LOGGER.error('Error during data update: %s', err)
return
async_dispatcher_send(hass, TOPIC_UPDATE) async_dispatcher_send(hass, TOPIC_UPDATE)
hass.services.async_register(DOMAIN, 'update_data', update_data) hass.services.async_register(DOMAIN, 'update_data', update_data)