Skip to content

fix: per-door listeners deliver None for a null or partial DoorState - #61

Merged
Bre77 merged 1 commit into
mainfrom
fm/stream-f57-null-guard
Oct 21, 2026
Merged

Bre77 merged 1 commit into
mainfrom
fm/stream-f57-null-guard

Conversation

@Bre77

@Bre77 Bre77 commented Oct 21, 2026

Copy link
Copy Markdown
Member

The six per-door listeners (listen_FrontDriverDoor, listen_RearDriverDoor, listen_FrontPassengerDoor, listen_RearPassengerDoor, listen_TrunkFront, listen_TrunkRear) called .get on the raw DoorState value, so a null DoorState raised AttributeError. BLE broadcast ingest (home-assistant/core#184816) can emit a null or partial DoorState. A new make_door factory returns None when DoorState is not a dict, matching make_dict.

Adds tests/test_door_state_null.py. Release is a separate step.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Teslemetry/coderabbit/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Team
  • Run ID: d78d1b0e-3c77-478b-91d8-8267f2107263
📥 Commits

Reviewing files that changed from the base of the PR and between 3eb6125 and 4c7dfbf.

📒 Files selected for processing: 2
  • teslemetry_stream/vehicle.py
  • tests/test_door_state_null.py

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

📝 Walkthrough

The six door-state listeners now use a shared factory to extract door values. The factory passes None for non-dictionary payloads. A regression test checks callback results for complete, partial, and null DoorState payloads.

Changes: Door-state callback handling

Layer / File(s) Summary
Null-safe door-state dispatch
teslemetry_stream/vehicle.py, tests/test_door_state_null.py
The six door listeners use make_door to extract values from dictionary-shaped DoorState data. The factory passes None for non-dictionary data. Tests cover complete, partial, and null payloads.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 4c7df

The door callbacks handle null and partial states as intended. No identified issue blocks merging after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 56.25% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: per-door listeners now return None for null or partial DoorState values.
Description check Passed The description accurately explains the DoorState issue, the make_door factory, the affected listeners, and the regression test.
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.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@Bre77
Bre77 merged commit 6f94b2c into main Oct 21, 2026
15 checks passed
@Bre77
Bre77 deleted the fm/stream-f57-null-guard branch October 21, 2026 10:12
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