Revert "fix: Complete fixes: tests, workflows, coverage"
This reverts commit ed94d40e96
.
This commit is contained in:
@@ -139,10 +139,6 @@ class AdGuardControlHubCoordinator(DataUpdateCoordinator):
|
||||
results = await asyncio.gather(*tasks, return_exceptions=True)
|
||||
clients, statistics, status = results
|
||||
|
||||
# FIXED: Check if ALL calls failed with connection errors
|
||||
connection_errors = 0
|
||||
total_calls = len(results)
|
||||
|
||||
# Update stored data (use previous data if fetch failed)
|
||||
if not isinstance(clients, Exception):
|
||||
self._clients = {
|
||||
@@ -152,26 +148,16 @@ class AdGuardControlHubCoordinator(DataUpdateCoordinator):
|
||||
}
|
||||
else:
|
||||
_LOGGER.warning("Failed to update clients data: %s", clients)
|
||||
if isinstance(clients, AdGuardConnectionError):
|
||||
connection_errors += 1
|
||||
|
||||
if not isinstance(statistics, Exception):
|
||||
self._statistics = statistics
|
||||
else:
|
||||
_LOGGER.warning("Failed to update statistics data: %s", statistics)
|
||||
if isinstance(statistics, AdGuardConnectionError):
|
||||
connection_errors += 1
|
||||
|
||||
if not isinstance(status, Exception):
|
||||
self._protection_status = status
|
||||
else:
|
||||
_LOGGER.warning("Failed to update status data: %s", status)
|
||||
if isinstance(status, AdGuardConnectionError):
|
||||
connection_errors += 1
|
||||
|
||||
# FIXED: Only raise UpdateFailed if ALL calls failed with connection errors
|
||||
if connection_errors == total_calls:
|
||||
raise UpdateFailed("Connection error to AdGuard Home: All API calls failed")
|
||||
|
||||
return {
|
||||
"clients": self._clients,
|
||||
|
Reference in New Issue
Block a user