|
17 | 17 |
|
18 | 18 | from ..const import DOMAIN, MANUFACTURER, SWITCH_DELAYED_VERIFICATION_SLEEP_SECONDS |
19 | 19 | from ..coordinator import UnifiRuleUpdateCoordinator |
20 | | - |
21 | 20 | from ..helpers.rule import ( |
22 | 21 | get_object_id, |
23 | 22 | get_rule_enabled, |
@@ -547,9 +546,7 @@ async def handle_operation_complete(future): |
547 | 546 | # if the change was confirmed by the trigger system (which consumes the |
548 | 547 | # HA-initiated operation flag). If not, it forces a refresh. |
549 | 548 | async def delayed_verification(): |
550 | | - await asyncio.sleep( |
551 | | - SWITCH_DELAYED_VERIFICATION_SLEEP_SECONDS |
552 | | - ) # Wait for smart polling update |
| 549 | + await asyncio.sleep(SWITCH_DELAYED_VERIFICATION_SLEEP_SECONDS) # Wait for smart polling update |
553 | 550 | if self.coordinator.check_and_consume_ha_initiated_operation(self._rule_id): |
554 | 551 | # If the flag was still present, it means the trigger system |
555 | 552 | # did NOT get a change event. We must refresh. |
@@ -655,7 +652,9 @@ async def led_toggle_wrapper(device, state): |
655 | 652 | # Add the completion callback |
656 | 653 | future.add_done_callback(lambda f: self.hass.async_create_task(handle_operation_complete(f))) |
657 | 654 |
|
658 | | - LOGGER.debug("Successfully queued toggle operation for rule %s with target state: %s", self._rule_id, enable) |
| 655 | + LOGGER.debug( |
| 656 | + "Successfully queued toggle operation for rule %s with target state: %s", self._rule_id, enable |
| 657 | + ) |
659 | 658 | except Exception as err: |
660 | 659 | LOGGER.error("Failed to queue toggle operation for rule %s: %s", self._rule_id, err) |
661 | 660 | # Remove from pending operations if queueing failed |
|
0 commit comments