mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-12 02:18:02 +00:00
Initial support for vacuums (clean module) (#944)
Adds support for clean module: - Show current vacuum state - Start cleaning (all rooms) - Return to dock - Pausing & unpausing - Controlling the fan speed --------- Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
This commit is contained in:
@@ -676,9 +676,14 @@ class Discover:
|
||||
for key, val in candidates.items():
|
||||
try:
|
||||
prot, config = val
|
||||
_LOGGER.debug("Trying to connect with %s", prot.__class__.__name__)
|
||||
dev = await _connect(config, prot)
|
||||
except Exception:
|
||||
_LOGGER.debug("Unable to connect with %s", prot)
|
||||
except Exception as ex:
|
||||
_LOGGER.debug(
|
||||
"Unable to connect with %s: %s",
|
||||
prot.__class__.__name__,
|
||||
ex,
|
||||
)
|
||||
if on_attempt:
|
||||
ca = tuple.__new__(ConnectAttempt, key)
|
||||
on_attempt(ca, False)
|
||||
@@ -686,6 +691,7 @@ class Discover:
|
||||
if on_attempt:
|
||||
ca = tuple.__new__(ConnectAttempt, key)
|
||||
on_attempt(ca, True)
|
||||
_LOGGER.debug("Found working protocol %s", prot.__class__.__name__)
|
||||
return dev
|
||||
finally:
|
||||
await prot.close()
|
||||
|
Reference in New Issue
Block a user