Repository navigation
The review of Evok 3.1: a failed pulse, an empty API section, MQTT errors - #277
Merged
Merged
Conversation
…rors
- start_pulse() cancels the running sequence of the output after the
successful write of the new value, under the lock of the unit
(set_devices(replace_sequences=True)): a failed write, e.g. an unavailable
unit, left the output in the state of the old pulse without its end
- get_api() of an empty section (websocket: with the options commented out)
is {}, Evok did not start
- MQTT: an error of the connection which is not an MqttError (e.g. a missing
file of TLS) is logged once and the handler connects again, the loop ended
silently; an MqttError of a publish publishes the state again after the
delay, the publishing task ended silently and the states were not published
- /rest: an empty body with Content-Type application/json sets nothing, it was
a 400
- docs: the API changes against Evok 3.0.6 (main after it had the docs and
#191); EVOK_VER=3.1.0 and the links to the tag 3.1.0; the replacement of
a pulse in sequencer.md
- CI: the integration tests on the pushes to dev-*, not dev-3.1
- tests: the failed pulse, the old end before the new pulse, the empty section,
the MQTT errors, the empty JSON body
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rrors, the API sections
- set_devices(sequences={device: Sequence}) starts the new sequence after the
successful set() under the lock of the unit, it replaces the running one;
start_pulse() started the pulse after the read of the unit, a task cancelled
meanwhile left the output on without a sequence
- MQTT: a state refused by the client is published again after the other
pending ones, at most 3 times with 1 s between them, then dropped; it was
retried every 5 s forever and delayed the others. An error other than of
MQTT is logged once also when it comes after each connection, the message
says so
- the sections rpc, websocket, webhook and mqtt of apis are normalized when the
config is read: an empty one is {}, another value than a mapping is an error
of the config, Evok exits with it (also apis which is not a mapping); the
callers do not repeat `or {}`
- tests: the pulse cancelled after its write, the dropped publish, the error
after the connection, the API sections which are not a mapping
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miroslav-ondra
added a commit
that referenced
this pull request
Oct 26, 2026
The links of the docs and EVOK_VER on the tag 3.1.0 and the API changes against Evok 3.0.6 of dev-3.1 replace the links to main and the wording of the release commits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
The findings of the review of #276 (Evok 3.1.0), fixed in
dev-3.1before the release.Changes
A failed pulse left the output on (
blocks/device.py,modbus/base.py)start_pulse()cancelled the running sequence before it wrote the new value. When the write failed (an unavailable unit, an error of the communication), the old pulse was gone without its end and the output stayed on.set_devices(..., sequences={output: pulse}): the new sequence is started after the successfulset(), under the lock of the unit, it replaces the running one, whose step waiting for the lock writes nothing. A failed write leaves the old sequence running and it writes its end (withcheck_available=False). The pulse runs also when the task is cancelled during the read after the write, e.g. at the shutdown.An empty section of an API stopped the start (
config.py)websocket:orwebhook:with all options commented out isNonein YAML,evok.pyfailed on.get(). The sectionsrpc,websocket,webhookandmqttare normalized when the config is read: an empty one is{}, another value than a mapping (e.g.websocket: true) is an error of the config and Evok exits with it.MQTT stopped silently (
mqtt_handler.py)MqttError, e.g. a missing CA file of TLS, ended the loop of the connection without a log. It is logged once with its traceback (also when it comes after each connection) and the handler connects again afterRECONNECT_DELAY.MqttErrorof a publish (e.g. a full queue of the client) ended the publishing task while the connection stayed open, no state was published any more. The state is published again after the other pending ones, at most 3 times 1 s apart, then dropped (e.g. refused by the size or the ACL of the broker); a lost connection ends the loop of the commands, which cancels the publishing as before.REST (
evok.py)Content-Type: application/jsonsets nothing as without the header, it was a 400.Docs and CI
api-changes-dev-src.mdcompiled against Evok 3.0.6;mainafter it had only the docs and Fix websocket blocking requests #191.EVOK_VER=3.1.0and the links to the udev rule andexamples/config.yamlon the tag3.1.0, the tag of the release (they are 404 until it exists).sequencer.md: a new pulse replaces the running one after its write.dev-*, notdev-3.1.Testing
pytest tests: 1254 passed; new tests: the failed pulse (the old one writes its end), the pulse cancelled after its write, the end of the old pulse before the new one, the new pulse before the end of the old one, the empty section of an API, a section which is not a mapping, the other error of the MQTT connection and after the connection, the failed and the dropped publish, the empty JSON body. Each fails without its fix.ruff checkandruff format --check srcclean.led ext2_01replaced by a pulse of 2 s, the LED stays on after 1.3 s, off after 2.3 s; an empty JSON body to/rest/led/ext2_01is 200.🤖 Generated with Claude Code