Skip to content

Commit

Permalink
Fix key error MQTT binary_sensor when no name is set (#99943)
Browse files Browse the repository at this point in the history
Log entitty ID when instead of name
  • Loading branch information
jbouwh committed Sep 8, 2023
1 parent bd1d867 commit 677431e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/mqtt/binary_sensor.py
Expand Up @@ -215,7 +215,7 @@ def state_message_received(msg: ReceiveMessage) -> None:
"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),
Expand All @@ -240,7 +240,7 @@ def state_message_received(msg: ReceiveMessage) -> None:
"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,
Expand Down

0 comments on commit 677431e

Please sign in to comment.