mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +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]:
|
async def async_get_connected_devices(self) -> dict[str, WrtDevice]:
|
||||||
"""Get list of connected devices."""
|
"""Get list of connected devices."""
|
||||||
try:
|
|
||||||
api_devices = await self._api.async_get_connected_devices()
|
api_devices = await self._api.async_get_connected_devices()
|
||||||
except OSError as exc:
|
|
||||||
raise UpdateFailed(exc) from exc
|
|
||||||
return {
|
return {
|
||||||
format_mac(mac): WrtDevice(dev.ip, dev.name, None)
|
format_mac(mac): WrtDevice(dev.ip, dev.name, None)
|
||||||
for mac, dev in api_devices.items()
|
for mac, dev in api_devices.items()
|
||||||
@ -343,10 +340,7 @@ class AsusWrtHttpBridge(AsusWrtBridge):
|
|||||||
|
|
||||||
async def async_get_connected_devices(self) -> dict[str, WrtDevice]:
|
async def async_get_connected_devices(self) -> dict[str, WrtDevice]:
|
||||||
"""Get list of connected devices."""
|
"""Get list of connected devices."""
|
||||||
try:
|
|
||||||
api_devices = await self._api.async_get_connected_devices()
|
api_devices = await self._api.async_get_connected_devices()
|
||||||
except AsusWrtError as exc:
|
|
||||||
raise UpdateFailed(exc) from exc
|
|
||||||
return {
|
return {
|
||||||
format_mac(mac): WrtDevice(dev.ip, dev.name, dev.node)
|
format_mac(mac): WrtDevice(dev.ip, dev.name, dev.node)
|
||||||
for mac, dev in api_devices.items()
|
for mac, dev in api_devices.items()
|
||||||
|
@ -216,7 +216,7 @@ class AsusWrtFlowHandler(ConfigFlow, domain=DOMAIN):
|
|||||||
if error is not None:
|
if error is not None:
|
||||||
return error, None
|
return error, None
|
||||||
|
|
||||||
_LOGGER.info(
|
_LOGGER.debug(
|
||||||
"Successfully connected to the AsusWrt router at %s using protocol %s",
|
"Successfully connected to the AsusWrt router at %s using protocol %s",
|
||||||
host,
|
host,
|
||||||
protocol,
|
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.device_registry import DeviceInfo, format_mac
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||||
from homeassistant.helpers.event import async_track_time_interval
|
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 homeassistant.util import dt as dt_util, slugify
|
||||||
|
|
||||||
from .bridge import AsusWrtBridge, WrtDevice
|
from .bridge import AsusWrtBridge, WrtDevice
|
||||||
@ -276,7 +276,7 @@ class AsusWrtRouter:
|
|||||||
_LOGGER.debug("Checking devices for ASUS router %s", self.host)
|
_LOGGER.debug("Checking devices for ASUS router %s", self.host)
|
||||||
try:
|
try:
|
||||||
wrt_devices = await self._api.async_get_connected_devices()
|
wrt_devices = await self._api.async_get_connected_devices()
|
||||||
except UpdateFailed as exc:
|
except (OSError, AsusWrtError) as exc:
|
||||||
if not self._connect_error:
|
if not self._connect_error:
|
||||||
self._connect_error = True
|
self._connect_error = True
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user