Adopt the observation funnel for Teslemetry charge port and front trunk - #988
Draft
Bre77 wants to merge 3 commits into
Draft
Adopt the observation funnel for Teslemetry charge port and front trunk#988Bre77 wants to merge 3 commits into
Bre77 wants to merge 3 commits into
Conversation
Shared by teslemetry, tesla_fleet and tessie, so all three manifests move together. 1.11.0 adds the ObservationFunnel the closure covers adopt in the following commit.
Route the Bluetooth charge-port and front-trunk covers through a per-vehicle tesla_fleet_api ObservationFunnel with BleBroadcastPublisher and VehicleDataResultPublisher attached, so each renders a value from either the BLE broadcast or vehicle_data and survives the loss of one source. Demand signalling drives both sources: the BLE publisher subscribes only while a field is listened to, and a demand observer gates the vehicle_data feed. The lock and rear trunk stay on the existing single-source BLE path.
The funnel keeps its structure and BLE broadcast publisher, but the VehicleDataResultPublisher and the coordinator-fed path that existed only to feed it are removed: streaming signals, not vehicle_data, are the intended second source and no stream publisher exists yet. While the funnel is single-source BLE, the funnelled charge-port-door and front-trunk entities re-impose the BLE connection-generation tie so a dropped link clears the value, matching ble.py; this is removed once a second source is attached.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking change
Proposed change
Route the Bluetooth charge-port and front-trunk covers through a per-vehicle
ObservationFunnelfromtesla-fleet-api. Only the library'sBleBroadcastPublisheris attached: streaming signals, notvehicle_data, arethe intended second source, and no stream publisher exists in the library yet,
so the funnel stays single-source BLE for now. The BLE publisher subscribes to a
broadcast only while its field is listened to. Commands still route through the
command router.
While the funnel is single-source BLE, the funnelled covers keep the
connection-generation tie of the prior local BLE path: a dropped link makes the
last broadcast stale and the cover unavailable, rather than leaving a parked,
disconnected vehicle showing its last reading indefinitely. That tie is removed
once a second source is attached and a value can outlive the BLE link.
The lock and rear trunk stay on the existing single-source BLE path: the funnel
maps only
LOCKED/UNLOCKED, whereas this integration also treatsINTERNAL_LOCKED/SELECTIVE_UNLOCKEDas locked/unlocked, so adopting the funnelfor the lock would drop those states in the BLE-only case.
The shared
tesla-fleet-api1.11.0 bump (teslemetry, tesla_fleet, tessie) thatships the funnel is bundled here so this rung's tests run against the released
library; upstream it will be split into its own dependency-upgrade PR per the
one-subject rule.
This stacks on #982 (its base branch), extending the local-Bluetooth read series
with the library funnel.
Type of change
Additional information
tesla-fleet-api1.8.0 → 1.11.0): Teslemetry/python-tesla-fleet-api@v1.8.0...v1.11.0Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: