From 999eeb39b919b4549fd912d4b2d311c634f48bf3 Mon Sep 17 00:00:00 2001 From: Joakim Plate Date: Tue, 6 Oct 2020 06:12:39 +0200 Subject: [PATCH] Indicate to user that remote was turned off when call was attempted (#40715) * Indicate to user that remote was turned off when call was attempted * Catch exception in test * Switch to warning log * Apply suggestions from code review Add suggested change to loggin --- homeassistant/components/broadlink/remote.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/homeassistant/components/broadlink/remote.py b/homeassistant/components/broadlink/remote.py index 32305331a21..7c7a05ac167 100644 --- a/homeassistant/components/broadlink/remote.py +++ b/homeassistant/components/broadlink/remote.py @@ -243,6 +243,9 @@ class BroadlinkRemote(RemoteEntity, RestoreEntity): delay = kwargs[ATTR_DELAY_SECS] if not self._state: + _LOGGER.warning( + "remote.send_command canceled: %s entity is turned off", self.entity_id + ) return should_delay = False @@ -285,6 +288,9 @@ class BroadlinkRemote(RemoteEntity, RestoreEntity): toggle = kwargs[ATTR_ALTERNATIVE] if not self._state: + _LOGGER.warning( + "remote.learn_command canceled: %s entity is turned off", self.entity_id + ) return should_store = False