fix(dev-setup): install ebus-emitter from its lock; bump to 1.0.12 - #30
Merged
Merged
Conversation
…lving
`uv pip install --editable <path>` re-resolves the emitter's dependency
constraints against PyPI and ignores the emitter's own uv.lock. Its
`ebus-sdk>=0.1.5` constraint therefore resolved to 0.12.0 on a fresh
bootstrap, pulling in an SDK the emitter has never been tested against.
ebus-sdk 0.2.0 changed the `Device` constructor's `mqtt_cfg` default from
`{}` to `None` (alongside the parent/child tree rework). The emitter's
build_graph() constructs the root Device as a passive topic/schema model
with no mqtt_cfg, so `connect_broker()` dereferenced None and every panel
failed to start:
AttributeError: 'NoneType' object has no attribute 'get'
tests/test_panel.py::TestPanelInstance::test_start_and_stop already
covered this — it just had not been re-run after the venv drifted.
Install the emitter's locked runtime dependencies first (`uv export` from
its lock), then the emitter itself with `--no-deps` so nothing is
re-resolved. The venv now matches exactly what the emitter pins.
ebus-emitter carries a matching `ebus-sdk<0.2` upper bound so the
constraint is enforced declaratively as well.
Matches the release/v1.0.12 branch. sync-version.sh propagated the pyproject version to __init__.py, config.yaml, and the Dockerfile label. The root CHANGELOG's `[unreleased]` section — emitter live-schema alignment and abstraction, plus the dev-bootstrap dependency-drift fix — is now stamped as 1.0.12.
The add-on changelog stopped at 1.0.11, so 1.0.12 would have shipped with no user-facing release notes. Covers the emitter cutover and the schema changes downstream consumers will notice — flat Homie 5 layout, renamed lugs and firmware-version keys, multi-EVSE publishing, per-panel MQTT connections, retained-topic cleanup on stop — plus the startup failure caused by the unpinned emitter dependency resolve.
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.
Problem
Starting the simulator failed for every panel:
Root cause
scripts/dev-setup.shinstalled the emitter with a bareuv pip install --editable <path>. That re-resolves the emitter's dependency constraints against PyPI and ignores the emitter's ownuv.lock(which pinsebus-sdk0.1.5). A fresh bootstrap therefore resolvedebus-sdk>=0.1.5to 0.12.0.Per the SDK's own metadata: "0.2.0 introduces parent/child device trees and contains breaking changes to the
Deviceconstructor." Among them,mqtt_cfg's default changed from{}toNone. The emitter'sbuild_graph()constructs the rootDeviceas a passive topic/schema model with nomqtt_cfg, soconnect_broker()dereferencedNonebefore the graph was ever built.Minimal repro, no simulator involved:
Fix
dev-setup.shnow installs the emitter's locked runtime deps (uv exportfrom its lock), then the emitter itself with--no-depsso nothing is re-resolved. The venv matches exactly what the emitter pins.ebus-emittercarries a matchingebus-sdk>=0.1.5,<0.2upper bound (committed separately in that repo), so the constraint is enforced declaratively too.sync-version.shpropagated it to__init__.py,config.yaml, and the Dockerfile label.CHANGELOG.md[unreleased]stamped as 1.0.12, and the add-onCHANGELOG.md— which had stopped at 1.0.11 — gets a 1.0.12 section covering the emitter cutover and the schema changes downstream consumers will notice.Verification
tests/test_panel.py::TestPanelInstance::test_start_and_stopwas failing with the identicalAttributeError. It already covered this; it just had not been re-run after the venv drifted. Now passes.Panel sim-40t-001 started (config=MAIN_40.yaml)/Reload complete: started=1, stopped=0, reloaded=0, errors=0.Follow-up, not addressed here
The emitter uses
ebus_sdk.Devicepurely as a topic/schema model —Publishersends everything over the producer's aiomqtt client and only readsget_device_id()/get_node_id()/id(). But on 0.1.5, constructing that model also opens a second, unmanaged paho connection to the default broker and publishes$description/$stateon it. That is pre-existing, not a regression, and it is the same knot that makes moving to ebus-sdk 0.2+ non-trivial: the newer SDK requires a rootDeviceto own a broker connection, which conflicts with the emitter's "producer owns the connection" design. Worth settling before raising that version bound.