Repository navigation
Add doorlock, intercom, charger, sensors, energy commands and security hardening - #33
Merged
Merged
Conversation
- Validate UUIDs in send_cmd/get_all to prevent path traversal attacks - Stricter is_uuid(): only hex chars and dashes allowed - Add request_with_retry() with exponential backoff (3 attempts) - Add verify_ssl config option (default: false for self-signed certs) - Add --verify-ssl flag to setup set command https://claude.ai/code/session_01MGpgD2VXRVnNWZoEStcknK
…music/alarm New commands: - doorlock: lock/unlock/open for DoorLock controls - intercom: answer/hangup/open for Intercom controls - charger: start/stop/pause with optional --limit for EV chargers - sensors: list sensor readings filtered by type (temperature, door-window, motion, smoke) - energy: show energy meter readings Extended commands: - music: add next, prev, mute, unmute subcommands - alarm: add arm-home mode and --code PIN support for arm/disarm - on/off: add --all-in-room flag for room-wide control https://claude.ai/code/session_01MGpgD2VXRVnNWZoEStcknK
- Add tests for resolve_all_in_room (with/without type filter, empty room) - Add stricter is_uuid tests (reject non-hex, no-dash, human strings) - Add retry logic test - Fix clippy wildcard_in_or_patterns warning in sensors command https://claude.ai/code/session_01MGpgD2VXRVnNWZoEStcknK
- Add type check for Charger/EV controls before executing charger commands (matching doorlock/intercom pattern) - Replace fragile string matching in retry logic with structured HttpStatusError downcast for 4xx detection - Use expect() instead of unwrap() on last_err for clearer panic message Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Feature expansion of the lox CLI to cover additional Loxone control types and improve security:
Security & Robustness
send_cmd/get_allnow validate UUIDs before URL construction, preventing path traversal attacksis_uuid(): Only hex characters and dashes allowed (was: any string with a dash and len > 20)request_with_retry()with exponential backoff (200ms/400ms/800ms), skips 4xx errorsverify_sslconfig option and--verify-sslflag onsetup setNew Commands
doorlock: lock/unlock/open for DoorLock controlsintercom: answer/hangup/open for Intercom controlscharger: start/stop/pause with optional--limitfor EV chargerssensors: list sensor readings filtered by type (temperature, door-window, motion, smoke)energy: show energy meter readings (Meter, EnergyManager, EnergyMonitor)Extended Commands
music: addednext,prev,mute,unmutesubcommandsalarm: addedarm-homemode and--codePIN support for arm/disarmon/off: added--all-in-roomflag for room-wide controlTesting
Test plan
cargo test— 67 tests passcargo clippy— no warningscargo build --release— builds successfullylox on --all-in-room "Wohnzimmer"lox alarm arm --code 1234lox music next,lox music mutelox sensors --type temperaturehttps://claude.ai/code/session_01MGpgD2VXRVnNWZoEStcknK