mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Fix BroadlinkRemote._learn_command() (#116692)
This commit is contained in:
parent
fd398a3b3c
commit
453ce0fc4e
@ -373,8 +373,11 @@ class BroadlinkRemote(BroadlinkEntity, RemoteEntity, RestoreEntity):
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user