From 75c666ccb2b55e0ea282ae38320015aae7d3c5d1 Mon Sep 17 00:00:00 2001 From: Steven Emelander Date: Wed, 11 Mar 2026 10:36:49 -0400 Subject: [PATCH] Fix legacy firmware (2.x) response format in invoke() Legacy firmware omits the method name from invoke() responses. Handle this by treating it as optional instead of required. --- src/aiovantage/_object_interfaces/base.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/aiovantage/_object_interfaces/base.py b/src/aiovantage/_object_interfaces/base.py index f37046d1..8b6c9efe 100644 --- a/src/aiovantage/_object_interfaces/base.py +++ b/src/aiovantage/_object_interfaces/base.py @@ -183,10 +183,11 @@ async def invoke( # Break the response into tokens return_line = response[-1] - _command, _vid, result, _method, *args = Converter.tokenize(return_line) + _command, _vid, result, *args = Converter.tokenize(return_line) - # Parse the response - return self._parse_object_response(method, result, *args, as_type=as_type) + # Skip the echoed method name if present; legacy firmware (2.x) + # omits it, while modern firmware includes it as the first arg. + return self._parse_object_response(method, result, *args[1:], as_type=as_type) def update_properties(self, properties: dict[str, Any]) -> list[str]: """Update object properties.