From 7e8cbafc6f4ac511c8d99f5264c8def76f4983db Mon Sep 17 00:00:00 2001 From: Felipe Martins Diel <41558831+felipediel@users.noreply.github.com> Date: Fri, 3 May 2024 08:11:22 -0300 Subject: [PATCH] Fix BroadlinkRemote._learn_command() (#116692) --- homeassistant/components/broadlink/remote.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/broadlink/remote.py b/homeassistant/components/broadlink/remote.py index 55368e5ff59ee2..77c9ea0ff98e18 100644 --- a/homeassistant/components/broadlink/remote.py +++ b/homeassistant/components/broadlink/remote.py @@ -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)