From 5e77dc1ab98321c423d8d5e8ffcb50a9c5a7e8fd Mon Sep 17 00:00:00 2001 From: Sam Stenvall Date: Wed, 11 Sep 2024 13:24:43 +0300 Subject: [PATCH] Log the response that triggered the error Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1300, in async_device_update await self.async_update() File "/config/custom_components/vinx/media_player.py", line 97, in async_update video_channel_id = await self._lw3.get_property("/SYS/MB/PHY.VideoChannelId") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/vinx/lw3.py", line 179, in get_property response = await asyncio.wait_for(self._run_get(path), self._timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for return await fut ^^^^^^^^^ File "/config/custom_components/vinx/lw3.py", line 155, in _run_get return await self._read_and_parse_response() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/vinx/lw3.py", line 143, in _read_and_parse_response result = parse_response(response.strip()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/vinx/lw3.py", line 94, in parse_response return parse_single_line_response(lines[1]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/vinx/lw3.py", line 70, in parse_single_line_response match get_response_type(response): ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/vinx/lw3.py", line 66, in get_response_type raise ValueError("Unknown response type") ValueError: Unknown response type --- custom_components/vinx/lw3.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/vinx/lw3.py b/custom_components/vinx/lw3.py index 07b2bb3..0d8d775 100644 --- a/custom_components/vinx/lw3.py +++ b/custom_components/vinx/lw3.py @@ -63,7 +63,7 @@ def get_response_type(response: str) -> ResponseType: elif response[0] == "m": return ResponseType.Method - raise ValueError("Unknown response type") + raise ValueError(f"Unknown response type: {response}") def parse_single_line_response(response: str) -> SingleLineResponse: