Skip to content

Cap tesla-protocol below 6 - #207

Merged
Bre77 merged 1 commit into
mainfrom
fm/tfa-protocol-6-compat
Oct 31, 2026
Merged

Bre77 merged 1 commit into
mainfrom
fm/tfa-protocol-6-compat

Conversation

@Bre77

@Bre77 Bre77 commented Oct 31, 2026

Copy link
Copy Markdown
Member

Problem

pyproject.toml declares tesla-protocol>=5.0.0 with no upper limit. uv.lock holds 5.0.0, so CI passes, but a fresh install resolves to 6.0.0 and these calls raise at runtime.

Fix

Add the <6 cap. uv.lock changes only in the recorded specifier and still resolves to 5.0.0. The tesla-protocol-bump skill now says to raise the cap only after a port.

Reproduction on tesla-protocol 6.0.0 (at 6cb3d99)

Library code 6.0.0 change Result
_local_envelope uses transport_pb2.LOCAL_PARTICIPANT_INSTALLER Enum moved to local_auth_api_pb2 AttributeError in get_status, get_firmware_details, get_device_controller, get_components
get_backup_events reads evt.sheduling_info Typo fixed to scheduling_info AttributeError when an event exists
_controllable_program reads getattr(schedule, field).seconds Field type changed from Timestamp to ControllableDeviceProgram_Schedule_Boundary AttributeError on any scheduled program
listen_ui_desire reads status.uiDesire (not in the original report) Field renamed to UIDesire AttributeError in the listener on the BLE broadcast path

tests/powerwall/test_tesla_protocol_compat.py catches the first two on 6.0.0 and misses the .seconds change, because the field name still exists. tests/powerwall/test_client.py catches that one. tests/test_ble_broadcast_listeners.py catches uiDesire. None of these tests can fail in CI today, because CI installs the locked 5.0.0.

Why a cap instead of a port

The cap is one specifier. A port that keeps 5.x working is not as small:

  • It needs a version branch at each of four call sites, because each symbol exists under only one name per major version.
  • The schedule change is a wire-type change. The new Boundary message needs a new parsing decision and proof against a real gateway. A rename cannot cover it.
  • 6.0.0 also renumbers the navigation trip-order enum: Replace goes from 1 to 0. The library passes order as a bare int, so the wire value stays the same but its meaning changes, with no exception.

The move to 6.x belongs in a tesla-protocol-bump change that raises the floor and drops 5.x.

Downstream resolver check

  • Nothing in the Teslemetry Python stack needs 6.x. teslemetry-stream 1.3.0 requires only aiohttp.
  • Home Assistant core dev does not pin tesla-protocol. Its protobuf==7.36.0 pin resolves with tesla-protocol>=5.0.0,<6 and teslemetry-stream==1.3.0.
  • The cap does not touch the aiopowerwall==0.10.0 conflict: that package requires tesla-protocol<5, so it is already unsatisfiable with this library's >=5.0.0 floor, without this cap.

Verification

  • Built a wheel and installed it into a clean venv: Requires-Dist: tesla-protocol<6,>=5.0.0, resolved to 5.0.0.
  • uv pip install of that wheel with tesla-protocol==6.0.0 fails to resolve.
  • pytest tests/powerwall tests/test_ble_broadcast_listeners.py tests/test_proto_compatibility.py in that venv: 265 passed. The same powerwall and broadcast files on 6.0.0: 9 failures.

No version bump in this PR. The cap reaches users only in the next release: released 1.20.0 declares tesla-protocol>=3.0.0, so a fresh install of it still resolves to 6.0.0.

tesla-protocol 6.0.0 renames and retypes symbols the library uses, so a
fresh install resolves to it and local Powerwall calls and listen_ui_desire
raise at runtime. uv.lock holds 5.0.0, so CI does not see this.
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 6cb3d99 and 2ed4f28.

Files ignored due to path filters: 1
  • uv.lock is excluded by !**/*.lock
Files selected for processing: 2
  • .claude/skills/tesla-protocol-bump/SKILL.md
  • pyproject.toml

Included review availability: This review used your included allowance. 1 included review remains after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Walkthrough

The tesla-protocol requirement now accepts versions from 5.0.0 up to, but not including, 6. The version-bump instructions say to raise the upper bound only after porting to the target major version.

Changes: Tesla protocol version constraint

Layer / File(s) Summary
Version requirement and bump guidance
.claude/skills/tesla-protocol-bump/SKILL.md, pyproject.toml
pyproject.toml now requires tesla-protocol>=5.0.0,<6. The bump instructions say to raise the cap after porting to the target major version.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to 2ed4f

The change prevents installation with the incompatible major version and documents the required porting step before the cap is raised.

Pre-merge checks: Passed 5
Check name Status Explanation
Description check Passed The description clearly explains the tesla-protocol 6.0.0 incompatibilities, the added upper-version cap, the skill update, and the verification performed.
Title check Passed The title clearly and concisely identifies the main change: capping tesla-protocol below version 6.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@Bre77
Bre77 merged commit 35300dd into main Oct 31, 2026
7 checks passed
@Bre77
Bre77 deleted the fm/tfa-protocol-6-compat branch October 31, 2026 03:32
@Bre77 Bre77 mentioned this pull request Oct 31, 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.

1 participant