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 GitHub
parent bd1d8675a9
commit 677431ed71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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,