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 logginpull/41325/head
parent
acb0307beb
commit
999eeb39b9
|
@ -243,6 +243,9 @@ class BroadlinkRemote(RemoteEntity, RestoreEntity):
|
||||||
delay = kwargs[ATTR_DELAY_SECS]
|
delay = kwargs[ATTR_DELAY_SECS]
|
||||||
|
|
||||||
if not self._state:
|
if not self._state:
|
||||||
|
_LOGGER.warning(
|
||||||
|
"remote.send_command canceled: %s entity is turned off", self.entity_id
|
||||||
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
should_delay = False
|
should_delay = False
|
||||||
|
@ -285,6 +288,9 @@ class BroadlinkRemote(RemoteEntity, RestoreEntity):
|
||||||
toggle = kwargs[ATTR_ALTERNATIVE]
|
toggle = kwargs[ATTR_ALTERNATIVE]
|
||||||
|
|
||||||
if not self._state:
|
if not self._state:
|
||||||
|
_LOGGER.warning(
|
||||||
|
"remote.learn_command canceled: %s entity is turned off", self.entity_id
|
||||||
|
)
|
||||||
return
|
return
|
||||||
|
|
||||||
should_store = False
|
should_store = False
|
||||||
|
|
Loading…
Reference in New Issue