Fix: Silently ignore empty JSON string object for MQTT IR signal payload (#177664)

This commit is contained in:
Jan Bouwhuis
2026-07-31 10:31:01 +02:00
committed by GitHub
parent 1e9f6d5ecf
commit 6e4d87182e
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -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,
+6
View File
@@ -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",