Skip to content

Commit

Permalink
fix(device): socket exception and process rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
rokam authored and wuwentao committed Sep 19, 2024
1 parent 4e5d61c commit 68da7fa
Show file tree
Hide file tree
Showing 4 changed files with 259 additions and 151 deletions.
9 changes: 7 additions & 2 deletions midealocal/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
get_midea_cloud,
get_preset_account_cloud,
)
from midealocal.device import AuthException, MideaDevice, ProtocolVersion, RefreshFailed
from midealocal.device import (
AuthException,
MideaDevice,
NoSupportedProtocol,
ProtocolVersion,
)
from midealocal.devices import device_selector
from midealocal.discover import discover
from midealocal.exceptions import SocketException
Expand Down Expand Up @@ -121,7 +126,7 @@ async def discover(self) -> list[MideaDevice]:
_LOGGER.debug("Unable to connect with key: %s", key)
except SocketException:
_LOGGER.exception("Device socket closed.")
except RefreshFailed:
except NoSupportedProtocol:
_LOGGER.exception("Unable to retrieve device attributes.")
else:
_LOGGER.info("Found device:\n%s", dev.attributes)
Expand Down
Loading

0 comments on commit 68da7fa

Please sign in to comment.