Bump wled 0.3.0, reduce calls stability improvements (#32903)

This commit is contained in:
Franck Nijhof authored and GitHub committed 2020-03-17 20:17:59 +01:00
1 parent 7bbffa6e6d
commit aece76f6cd
5 files changed
+19 -7

No files matched your search

+3 -3
View File
@@ -26,7 +26,7 @@ from .const import (
DOMAIN,
)
SCAN_INTERVAL = timedelta(seconds=10)
SCAN_INTERVAL = timedelta(seconds=5)
WLED_COMPONENTS = (LIGHT_DOMAIN, SENSOR_DOMAIN, SWITCH_DOMAIN)
_LOGGER = logging.getLogger(__name__)
@@ -94,7 +94,7 @@ def wled_exception_handler(func):
async def handler(self, *args, **kwargs):
try:
await func(self, *args, **kwargs)
await self.coordinator.async_refresh()
self.coordinator.update_listeners()
except WLEDConnectionError as error:
_LOGGER.error("Error communicating with API: %s", error)
@@ -128,7 +128,7 @@ class WLEDDataUpdateCoordinator(DataUpdateCoordinator):
async def _async_update_data(self) -> WLEDDevice:
"""Fetch data from WLED."""
try:
return await self.wled.update()
return await self.wled.update(full_update=not self.last_update_success)
except WLEDError as error:
raise UpdateFailed(f"Invalid response from API: {error}")