Skip to content

Commit 52f4a02

Browse files
dcjclaude
andauthored
release: 0.17.0 (inbound /set async dispatch + require ebus-mqtt-client 0.3.0) (#24)
Bumps __version__ to 0.17.0 and promotes the [Unreleased] CHANGELOG to [0.17.0]. Ships the inbound /set async dispatch work (#15): thread-safe run_coroutine_threadsafe scheduling, async_loop promoted to Device with per-tree propagation, and the =None default / Node mutable-default fixes. Raises the ebus-mqtt-client floor to >=0.3.0 (was >=0.2.0), the release that ships the py.typed marker: a downstream type checker now resolves the re-exported MqttClient to the concrete class instead of Any, completing the transport Protocol typing from 0.16.0. Tested green against 0.3.0. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 28dc569 commit 52f4a02

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ All notable changes to `ebus-sdk` are recorded here. Format follows [Keep a Chan
44

55
## [Unreleased]
66

7+
## [0.17.0] — 2026-08-02
8+
79
### Added
810

911
- `Device(async_loop=...)`: set the consumer's asyncio event loop once on the root instead of on every settable `Property`. It propagates to every property in the tree via `add_node()` / `Node.add_property()` (like QoS) and is inherited by child devices, so inbound `/set` callbacks for a tree with N settable properties no longer configure the loop N times. The per-`Property` `async_loop` argument still works and is preserved when no device-level loop is set. ([#15](https://github.com/electrification-bus/python-sdk/issues/15))
1012

13+
### Changed
14+
15+
- Dependency floor: `ebus-mqtt-client>=0.3.0` (was `>=0.2.0`). 0.3.0 ships the PEP 561 `py.typed` marker, so a downstream type checker resolves the re-exported `MqttClient` to the concrete class instead of `Any`, completing the transport `Protocol` typing (`MqttTransport` / `MqttControllerTransport` / `MqttDeviceTransport`) added in 0.16.0. The bump requires the typed transport rather than any new runtime API: 0.3.0 adds nothing the SDK's runtime needs beyond 0.2.0, and the test suite passes unchanged against it.
16+
1117
### Fixed
1218

1319
- Inbound `/set` on a settable property with an async (coroutine) callback is now dispatched to the consumer's event loop with `asyncio.run_coroutine_threadsafe` instead of `asyncio.ensure_future`. `/set` arrives on the transport's network-loop thread, and `ensure_future` is not safe to call from a thread other than the loop's own, so the previous path could misbehave on a real async host. The dispatch now branches on whether the callback returns a coroutine (not merely on a loop being configured), so a synchronous callback keeps running inline even when a tree-wide loop is set, and an exception raised inside an async callback is logged rather than silently swallowed by the discarded scheduling future. The `async_loop` default is corrected from `False` to `None` (a bool against the event-loop annotation, which `py.typed` surfaces), and `Node`'s mutable default `properties={}` is replaced with `None` (a shared-dict footgun the new propagation reads and writes through). ([#15](https://github.com/electrification-bus/python-sdk/issues/15))

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ See [`examples/README.md`](examples/README.md) for example scripts demonstrating
279279
## Requirements
280280

281281
- Python 3.10+
282-
- [`ebus-mqtt-client`](https://github.com/electrification-bus/ebus-mqtt-client) >= 0.2.0 (the MQTT transport layer; it pins `paho-mqtt`, so the SDK does not depend on paho directly. 0.2.0 adds the `on_disconnect_callback` the SDK's disconnect hook adopts; it also carries, since 0.1.8, the asynchronous, down-broker-tolerant connect the resilient-connect behavior relies on)
282+
- [`ebus-mqtt-client`](https://github.com/electrification-bus/ebus-mqtt-client) >= 0.3.0 (the MQTT transport layer; it pins `paho-mqtt`, so the SDK does not depend on paho directly. 0.3.0 ships the `py.typed` marker, so a downstream type checker resolves the re-exported `MqttClient` to the concrete class rather than `Any`; 0.2.0 adds the `on_disconnect_callback` the SDK's disconnect hook adopts; and, since 0.1.8, it carries the asynchronous, down-broker-tolerant connect the resilient-connect behavior relies on)
283283

284284
Optional extras:
285285

pyproject.toml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ classifiers = [
3030
dependencies = [
3131
# MQTT transport lives in ebus-mqtt-client, which pins paho-mqtt; the SDK
3232
# does not import paho directly, so paho is a transitive dependency (not
33-
# declared here). Floor 0.2.0: the SDK adopts the client's
34-
# on_disconnect_callback for push disconnect notification (SDK-al5), added in
35-
# 0.2.0. It also relies (since 0.1.8) on the client's connect_async
36-
# construction for resilient-connect completeness (full tree republish on the
37-
# first connect, construction-decoupled from broker availability); older
38-
# clients raised ConnectionRefusedError on a down broker.
39-
"ebus-mqtt-client>=0.2.0",
33+
# declared here). Floor 0.3.0: it ships the PEP 561 py.typed marker, so a
34+
# downstream type checker resolves the re-exported MqttClient to the concrete
35+
# class instead of Any, completing the transport Protocol typing (MqttTransport
36+
# / MqttControllerTransport / MqttDeviceTransport) the SDK added in 0.16.0.
37+
# Earlier floors, still relied on: 0.2.0 added the on_disconnect_callback the
38+
# disconnect hook adopts (SDK-al5); 0.1.8 added the connect_async construction
39+
# the resilient-connect behavior relies on (older clients raised
40+
# ConnectionRefusedError on a down broker).
41+
"ebus-mqtt-client>=0.3.0",
4042
]
4143

4244
[project.optional-dependencies]

src/ebus_sdk/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
# Structural types for a caller-supplied MQTT client
8282
from ebus_sdk.transport import MqttControllerTransport, MqttDeviceTransport, MqttTransport
8383

84-
__version__ = "0.16.0"
84+
__version__ = "0.17.0"
8585

8686
__all__ = [
8787
# Homie classes

0 commit comments

Comments
 (0)