Repository navigation
Conversation
Loxone Config decides whether an opened .Loxone file is the program already on the Miniserver by the Document element's Date/DateS stamp, not by content. lox-cli edits never touched it, so Config treated edited files as identical and loaded the Miniserver's old program, silently dropping the edits. Add ConfigEditor::stamp_document(now), which sets Date to the local wall-clock time (%Y-%m-%d %H:%M:%S) and DateS to whole seconds since the Loxone epoch (2009-01-01 00:00:00 UTC) for the same instant, changing only those two attributes in place. save_edited() calls it when the edit actually changed the serialised output compared with an unedited round-trip of the input, so no-op saves keep the stamp. to_bytes() stays a pure serialiser.
…stakes Three new `lox config validate` warnings for wiring Loxone Config accepts but that does nothing (or the wrong thing) on the Miniserver: - LightController2 with Move/Presence wired whose motion table (LSConfig OpM) has no "All other times" row (778) and lacks a row for an operating mode that at least half of the other motion-wired controllers list, or has no rows at all: motion does nothing while that mode is active. Comparing with the other controllers keeps the rule quiet on projects whose own modes cover the whole day. - A pulse longer than 0.2 s into a mood input Sel1..SelN from an EdgeDetection (PulseTime) or Monoflop (Time), using Loxone's defaults (1 s / 2 s) when no Def is set: it counts as a long-click and mixes the mood in instead of selecting it. - A wire from the Q output of an InputRef whose referenced element is not a Memory flag. Wires into OutputRefLM (Caller/Mailer/Logger references) are exempt, since sample configs use Q there legitimately.
This branch has not been deployed
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.
Summary
Two changes from editing a real house project with lox-cli and uploading the results to a Miniserver.
1. Bump the Document save stamp when an edit is saved
Loxone Config decides whether an opened
.Loxonefile is the program already on the Miniserver by the Document element'sDate/DateSstamp, not by its content. lox-cli edits never touched the stamp, so on Connect Config reported the program as identical and loaded the Miniserver's old program, and the edits were silently lost.ConfigEditor::stamp_document(now)sets:Dateto the local wall-clock time (%Y-%m-%d %H:%M:%S);DateSto whole seconds since the Loxone epoch (2009-01-01 00:00:00 UTC) for the same instant.Only those two attributes change, in place.
save_edited()stamps only when the output differs from an unedited round-trip of the input. A command that ends up changing nothing (e.g.layout --only-newwith nothing to place) keeps the old stamp.to_bytes()stays a pure serialiser, so no-op round-trips are still byte-identical.pushis not stamped.save_editednow takes&mut ConfigEditor, so this PR also updates its call sites.2. Three new
lox config validatewarningsEach one is wiring that Config accepts but that silently does nothing, or the wrong thing, on the Miniserver. All three caused real bugs:
Lighting Controller motion that does nothing in some operating modes. The rule applies to a controller with
MoveorPresencewired:LSConfig OpM) has no "All other times" row (778);A controller with no rows at all is also flagged. Comparing with the other controllers keeps the rule quiet on projects whose own modes cover the whole day.
A pulse longer than 0.2 s into a mood input (
Sel1..SelN, T5/x) from an EdgeDetection (PulseTime) or Monoflop (Time). Such a pulse counts as a long-click and mixes the mood in instead of selecting it (the controller then logs e.g."Dim All,Dim Wall"). When noDefis set, the rule uses Loxone's defaults (1 s / 2 s).A wire taken from the
Qof a reference to a device or virtual input. Config only usesAQthere, so the wire is neither drawn nor used;Qis valid on references to Memory flags. Wires intoOutputRefLM(Caller / Mailer / Logger references) are exempt, because the sample configs useQthere on purpose.COMMANDS.mddocuments both changes.Testing
DateSagainst values from real files;Date/DateSchange, with BOM and CRLF preserved;cargo fmt --check,cargo clippy -- -D warnings,cargo build --releaseandcargo testpass.PulseTime=1intoSel1);Qrule: 0 warnings.tests/eval/golden/configs, all three rules give 0 warnings.