Fix key error MQTT binary_sensor when no name is set (#99943)

Log entitty ID when instead of name
This commit is contained in:
Jan Bouwhuis 2023-09-08 19:10:17 +02:00 committed by Bram Kragten
parent f1bae7d37b
commit 06109d22fd

View File

@ -215,7 +215,7 @@ class MqttBinarySensor(MqttEntity, BinarySensorEntity, RestoreEntity):
"Empty template output for entity: %s with state topic: %s."
" Payload: '%s', with value template '%s'"
),
self._config[CONF_NAME],
self.entity_id,
self._config[CONF_STATE_TOPIC],
msg.payload,
self._config.get(CONF_VALUE_TEMPLATE),
@ -240,7 +240,7 @@ class MqttBinarySensor(MqttEntity, BinarySensorEntity, RestoreEntity):
"No matching payload found for entity: %s with state topic: %s."
" Payload: '%s'%s"
),
self._config[CONF_NAME],
self.entity_id,
self._config[CONF_STATE_TOPIC],
msg.payload,
template_info,