mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
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
@ -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…
x
Reference in New Issue
Block a user