Skip to content

Commit 047625a

Browse files
committed
Adapt tinker_switch() for added raise
1 parent 9d6962a commit 047625a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/test_smile.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,14 @@ async def tinker_switch(
465465
try:
466466
await smile.set_switch_state(dev_id, members, model, new_state)
467467
switch_change = True
468+
except pw_exceptions.PlugwiseException:
469+
_LOGGER.info(" + failed as expected")
468470
except (
469471
pw_exceptions.ErrorSendingCommandError,
470472
pw_exceptions.ResponseError,
471473
):
474+
switch_change = False
472475
if unhappy:
473-
switch_change = False
474476
_LOGGER.info(" + failed as expected")
475477
else: # pragma: no cover
476478
_LOGGER.info(" - failed unexpectedly")

0 commit comments

Comments
 (0)