Skip to content

Fix C1000 Gen 2 subscribe using the new send_command interface - #67

Open
alec-pinson wants to merge 1 commit into
flip-dots:mainfrom
alec-pinson:fix_c1000g2_subscribe
Open

Fix C1000 Gen 2 subscribe using the new send_command interface#67
alec-pinson wants to merge 1 commit into
flip-dots:mainfrom
alec-pinson:fix_c1000g2_subscribe

Conversation

@alec-pinson

@alec-pinson alec-pinson commented Sep 7, 2026

Copy link
Copy Markdown

_post_connect still calls _send_command with the pre-#61 signature (cmd as bytes, payload=), so the required parameters argument is never supplied:

File "SolixBLE/devices/c1000g2.py", line 62, in _post_connect
    await self._send_command(
TypeError: _send_command() missing 1 required positional argument: 'parameters'

connect() catches this, so the connection survives but the subscribe is never sent — and the Gen 2 streams no telemetry without it. Every sensor reads unavailable. Regression from 685573a, first released in 4.0.0b1.

The raw payload a10121 is parameter a1 with value 21, so it maps directly onto the new interface and the bytes on the wire are unchanged from 3.9.0.

Adds a command test asserting the subscribe builds cmd 4100 with payload a10121. It fails with the above TypeError without the fix.

Reproduced and verified on a real C1000 Gen 2 (A1763).

The new send_command() interface takes a str cmd and a parameters dict, but
_post_connect was still calling it with a bytes cmd and a raw payload. The
required parameters argument was therefore never supplied and every connection
raised TypeError, so the Gen 2 was never sent its subscribe command and streamed
no telemetry.

The raw payload a10121 is the parameter a1 with value 21, so it maps directly
onto the new interface and the bytes on the wire are unchanged.

Add a command test asserting the subscribe builds cmd 4100 with payload a10121.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

1 participant