mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Remove reserved UpdateFailed exception in AsusWRT (#110910)
* Remove reserved UpdateFailed exception in AsusWRT * Restore UpdateFailed exception in decorator
This commit is contained in:
parent
6e91776d65
commit
52621f9609
@ -211,10 +211,7 @@ class AsusWrtLegacyBridge(AsusWrtBridge):
|
||||
|
||||
async def async_get_connected_devices(self) -> dict[str, WrtDevice]:
|
||||
"""Get list of connected devices."""
|
||||
try:
|
||||
api_devices = await self._api.async_get_connected_devices()
|
||||
except OSError as exc:
|
||||
raise UpdateFailed(exc) from exc
|
||||
api_devices = await self._api.async_get_connected_devices()
|
||||
return {
|
||||
format_mac(mac): WrtDevice(dev.ip, dev.name, None)
|
||||
for mac, dev in api_devices.items()
|
||||
@ -343,10 +340,7 @@ class AsusWrtHttpBridge(AsusWrtBridge):
|
||||
|
||||
async def async_get_connected_devices(self) -> dict[str, WrtDevice]:
|
||||
"""Get list of connected devices."""
|
||||
try:
|
||||
api_devices = await self._api.async_get_connected_devices()
|
||||
except AsusWrtError as exc:
|
||||
raise UpdateFailed(exc) from exc
|
||||
api_devices = await self._api.async_get_connected_devices()
|
||||
return {
|
||||
format_mac(mac): WrtDevice(dev.ip, dev.name, dev.node)
|
||||
for mac, dev in api_devices.items()
|
||||
|
@ -216,7 +216,7 @@ class AsusWrtFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||
if error is not None:
|
||||
return error, None
|
||||
|
||||
_LOGGER.info(
|
||||
_LOGGER.debug(
|
||||
"Successfully connected to the AsusWrt router at %s using protocol %s",
|
||||
host,
|
||||
protocol,
|
||||
|
@ -20,7 +20,7 @@ from homeassistant.helpers import entity_registry as er
|
||||
from homeassistant.helpers.device_registry import DeviceInfo, format_mac
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||
from homeassistant.helpers.event import async_track_time_interval
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
from homeassistant.util import dt as dt_util, slugify
|
||||
|
||||
from .bridge import AsusWrtBridge, WrtDevice
|
||||
@ -276,7 +276,7 @@ class AsusWrtRouter:
|
||||
_LOGGER.debug("Checking devices for ASUS router %s", self.host)
|
||||
try:
|
||||
wrt_devices = await self._api.async_get_connected_devices()
|
||||
except UpdateFailed as exc:
|
||||
except (OSError, AsusWrtError) as exc:
|
||||
if not self._connect_error:
|
||||
self._connect_error = True
|
||||
_LOGGER.error(
|
||||
|
Loading…
x
Reference in New Issue
Block a user