Connection nodes speak of listener and sender, and of send_queue_size
mqtt and http take websocket's vocabulary: their Mode is LISTENER/SENDER, default names read mqtt_listener_… and http_listener_…, and mqtt's publish_queue_size is send_queue_size. No alias stays behind, so the flow store rewrites the old setting in every published and draft mqtt node when it opens, in the same migration as trigger → debounce. Every mqtt and http setting carries a one-line description for the editor, and the node-types reference uses one wording for direction and says that an http sender publishes a JSON object response on its outputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
@@ -29,7 +29,7 @@ def test_a_filter_does_not_cover_a_neighbouring_topic():
|
||||
assert not topic_matches("sensors/living/temp", "sensors/living")
|
||||
|
||||
|
||||
def _subscriber(topic, **params) -> MqttNode:
|
||||
def _listener(topic, **params) -> MqttNode:
|
||||
node = MqttNode(
|
||||
provides=[MessageSpec(name="reading", port="reading", dtype=DType.FLOAT)],
|
||||
params={"topic": {"reading": topic}, **params},
|
||||
@@ -40,7 +40,7 @@ def _subscriber(topic, **params) -> MqttNode:
|
||||
|
||||
def test_a_wildcard_subscription_routes_to_its_port():
|
||||
"""It used to subscribe and then drop every message it was sent."""
|
||||
node = _subscriber("shellypm/status/#")
|
||||
node = _listener("shellypm/status/#")
|
||||
assert node._ports_for("shellypm/status/pm1:0") == ["reading"]
|
||||
assert node._ports_for("shellypmc/status/pm1:0") == []
|
||||
|
||||
@@ -63,12 +63,12 @@ def test_an_exact_topic_still_wins_over_a_filter():
|
||||
|
||||
def test_json_key_lifts_the_value_a_device_wraps():
|
||||
"""Victron publishes {"value": 47} on every one of its topics."""
|
||||
node = _subscriber("N/x/battery/Soc", json_key="value")
|
||||
node = _listener("N/x/battery/Soc", json_key="value")
|
||||
assert node.json_keys == {"reading": "value"}
|
||||
|
||||
|
||||
def test_without_json_key_the_port_name_is_the_key_as_before():
|
||||
node = _subscriber("sensors/temp")
|
||||
node = _listener("sensors/temp")
|
||||
assert node.json_keys == {}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user