Don't mark Somfy devices as unavailable (#49662)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
a5e25e519f
commit
f7b72669dc
1 changed files with 4 additions and 2 deletions
|
@ -20,7 +20,6 @@ from homeassistant.helpers.entity import Entity
|
|||
from homeassistant.helpers.update_coordinator import (
|
||||
CoordinatorEntity,
|
||||
DataUpdateCoordinator,
|
||||
UpdateFailed,
|
||||
)
|
||||
|
||||
from . import api
|
||||
|
@ -95,7 +94,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
|||
previous_devices = data[COORDINATOR].data
|
||||
# Sometimes Somfy returns an empty list.
|
||||
if not devices and previous_devices:
|
||||
raise UpdateFailed("No devices returned")
|
||||
_LOGGER.debug(
|
||||
"No devices returned. Assuming the previous ones are still valid"
|
||||
)
|
||||
return previous_devices
|
||||
return {dev.id: dev for dev in devices}
|
||||
|
||||
coordinator = DataUpdateCoordinator(
|
||||
|
|
Loading…
Add table
Reference in a new issue