mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 10:48:01 +02:00
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:
@ -931,7 +931,11 @@ async def test_handle_logging_on_writing_the_entity_state(
|
||||
assert state is not None
|
||||
assert state.state == "initial_state"
|
||||
assert "Invalid value for sensor" in caplog.text
|
||||
assert "Exception raised when updating state of" in caplog.text
|
||||
assert (
|
||||
"Exception raised while updating "
|
||||
"state of sensor.test_sensor, topic: 'test/state' "
|
||||
"with payload: b'payload causing errors'" in caplog.text
|
||||
)
|
||||
|
||||
|
||||
async def test_receiving_non_utf8_message_gets_logged(
|
||||
|
Reference in New Issue
Block a user