Improve error logging on invalid MQTT entity state (#118006)
* Improve error logging on invalid MQTT entity state * Explain not hanlding TpeError and ValueError * Move length check closer to source * use _LOGGER.exception
This commit is contained in:
parent
7d44321f0f
commit
f12aee28a8
7 changed files with 106 additions and 12 deletions
|
@ -373,14 +373,14 @@ class EntityTopicState:
|
|||
def process_write_state_requests(self, msg: MQTTMessage) -> None:
|
||||
"""Process the write state requests."""
|
||||
while self.subscribe_calls:
|
||||
_, entity = self.subscribe_calls.popitem()
|
||||
entity_id, entity = self.subscribe_calls.popitem()
|
||||
try:
|
||||
entity.async_write_ha_state()
|
||||
except Exception:
|
||||
_LOGGER.exception(
|
||||
"Exception raised when updating state of %s, topic: "
|
||||
"Exception raised while updating state of %s, topic: "
|
||||
"'%s' with payload: %s",
|
||||
entity.entity_id,
|
||||
entity_id,
|
||||
msg.topic,
|
||||
msg.payload,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue