mirror of
https://github.com/home-assistant/core.git
synced 2026-08-03 20:24:55 +02:00
Fix: Silently ignore empty JSON string object for MQTT IR signal payload (#177664)
This commit is contained in:
@@ -220,7 +220,7 @@ class MqttInfraredReceiverEntity(MqttEntity, InfraredReceiverEntity):
|
||||
_LOGGER.debug("Ignoring retained infrared signal on topic %s", msg.topic)
|
||||
return
|
||||
payload = self._value_template(msg.payload)
|
||||
if not payload or payload in (PAYLOAD_NONE, "null"):
|
||||
if not payload or payload in (PAYLOAD_NONE, "null", '""'):
|
||||
_LOGGER.debug(
|
||||
"Ignoring payload for %s on topic %s, with template %s",
|
||||
self.entity_id,
|
||||
|
||||
@@ -183,6 +183,12 @@ async def test_receiving_command_success_using_value_template(
|
||||
logging.DEBUG,
|
||||
False,
|
||||
),
|
||||
(
|
||||
'""',
|
||||
"Ignoring payload for infrared.test on topic test-topic, with template None",
|
||||
logging.DEBUG,
|
||||
False,
|
||||
),
|
||||
(
|
||||
"None",
|
||||
"Ignoring payload for infrared.test on topic test-topic, with template None",
|
||||
|
||||
Reference in New Issue
Block a user