Repository navigation
lox hw ls / search / identify via the livelearn API - #414
Merged
Merged
Conversation
Use the Miniserver's device search API (jdev/sps/livelearn/...), the one the Loxone App uses in expert mode: - hw ls lists the paired Tree, Air and Link devices from listtree, with serial, base, room (named from the structure file) and online state. - hw search tree|air|<base> starts a search, sends keepalive every 10 s, polls results every 2 s and prints new devices as they appear. tree/air search every base of that technology one after the other. - hw identify <serial> finds the device's base and lets it flash. Search and identify always send their stop commands: when the time is up, on an error and on Ctrl-C (a second Ctrl-C quits at once). The loops take an Http and a Clock trait, so tests cover every exit with a fake Miniserver and virtual time. Nothing pairs devices. Tested live (firmware 17.3): hw ls, a 15 s tree search (liveSearch went back to isSearching:false) and a 5 s identify. Claude-Session: https://claude.ai/code/session_01Ms544aw3YwUGYox8c8BHA4
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #414 +/- ##
==========================================
- Coverage 77.40% 77.16% -0.24%
==========================================
Files 160 162 +2
Lines 52549 52993 +444
==========================================
+ Hits 40673 40892 +219
- Misses 11876 12101 +225
🚀 New features to boost your workflow:
|
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.
New subcommands on top of the Miniserver's
jdev/sps/livelearnweb service (the API the Loxone App uses for its expert-mode device search):lox hw ls [--tech tree|air|link|all]: paired devices with type, serial, base, room, online state (-o jsonadds uuid, switchboard, place).lox hw search <tree|air|base-serial> [--seconds N]: starts a search, keepalive every 10 s, prints new devices as they appear.tree/airsearch every base of that technology in turn. Never pairs anything.lox hw identify <serial> [--seconds N]: makes a paired device blink.Search and identify always send their stop commands: on timeout, on error and on Ctrl-C (first Ctrl-C ends the wait so the stop goes out, a second quits).
--dry-runprints the commands. 401/403 explains the needed rights (device management + expert mode).Tested with unit tests (fake clock and Miniserver for every exit path, anonymized fixtures) and live:
hw ls(56 devices),hw search tree --seconds 15(liveSearchwent true → false),hw identify5 s.Not included: pairing (
create/replace) — waits for a hardware experiment.https://claude.ai/code/session_01Ms544aw3YwUGYox8c8BHA4