Skip to content

Fix legacy firmware (2.x) response format in invoke()#355

Open
StevenEmelander wants to merge 1 commit intoloopj:mainfrom
StevenEmelander:fix/legacy-firmware-valueerror
Open

Fix legacy firmware (2.x) response format in invoke()#355
StevenEmelander wants to merge 1 commit intoloopj:mainfrom
StevenEmelander:fix/legacy-firmware-valueerror

Conversation

@StevenEmelander
Copy link

@StevenEmelander StevenEmelander commented Mar 11, 2026

Problem

Legacy Vantage InFusion firmware (2.x) omits the method name from invoke() responses:

Modern:  R:INVOKE <vid> <result> Load.GetLevel [args...]
Legacy:  R:GETLOAD <vid> <result>

The current code requires the method name via tuple unpacking, causing a ValueError that crashes controller initialization.

Fix

Treat the echoed method name as optional instead of required. The method name was already unused (discarded as _method) since the caller already knows what method was invoked.

No behavior change for modern firmware.

Fixes #354

@StevenEmelander StevenEmelander force-pushed the fix/legacy-firmware-valueerror branch from 556f2de to 06bc11c Compare March 11, 2026 14:41
@StevenEmelander StevenEmelander changed the title Fix fetch_state crash on legacy firmware due to unhandled ValueError in response parsing Fix legacy firmware compatibility in invoke() and Controller.fetch_state() Mar 11, 2026
@StevenEmelander StevenEmelander force-pushed the fix/legacy-firmware-valueerror branch 2 times, most recently from 00b946f to 40d741d Compare March 11, 2026 15:17
@StevenEmelander StevenEmelander changed the title Fix legacy firmware compatibility in invoke() and Controller.fetch_state() Fix legacy firmware (2.x) compatibility Mar 11, 2026
Legacy firmware omits the method name from invoke() responses.
Handle this by treating it as optional instead of required.
@StevenEmelander StevenEmelander force-pushed the fix/legacy-firmware-valueerror branch from 40d741d to 75c666c Compare March 11, 2026 15:35
@StevenEmelander StevenEmelander changed the title Fix legacy firmware (2.x) compatibility Fix legacy firmware (2.x) response format in invoke() Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Legacy firmware (2.x): ValueError in invoke() due to missing method name in response

1 participant