Skip to content

Commit

Permalink
Fix BroadlinkRemote._learn_command() (#116692)
Browse files Browse the repository at this point in the history
  • Loading branch information
felipediel authored and frenck committed May 3, 2024
1 parent a4f9a64 commit 7e8cbaf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions homeassistant/components/broadlink/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,11 @@ async def _async_learn_rf_command(self, command):
start_time = dt_util.utcnow()
while (dt_util.utcnow() - start_time) < LEARNING_TIMEOUT:
await asyncio.sleep(1)
found = await device.async_request(device.api.check_frequency)[0]
if found:
is_found, frequency = await device.async_request(
device.api.check_frequency
)
if is_found:
_LOGGER.info("Radiofrequency detected: %s MHz", frequency)
break
else:
await device.async_request(device.api.cancel_sweep_frequency)
Expand Down

0 comments on commit 7e8cbaf

Please sign in to comment.