Skip to content

Commit

Permalink
fix(device): no supported protocol caused high cpu usage
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao committed Dec 31, 2024
1 parent cb94101 commit e29e6af
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions midealocal/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,8 @@ def run(self) -> None: # noqa: PLR0915
break
except NoSupportedProtocol:
_LOGGER.debug("[%s] No Supported protocol", self._device_id)
# sleep 1 seconds to prevent high cpu usage in for loop
time.sleep(1)

Check warning on line 701 in midealocal/device.py

View check run for this annotation

Codecov / codecov/patch

midealocal/device.py#L701

Added line #L701 was not covered by tests
# ignore and continue loop
continue
except ConnectionResetError: # refresh_status -> build_send exception
Expand Down

0 comments on commit e29e6af

Please sign in to comment.