Repository navigation
fix: weather parsing, if comparison, time display, room qualifier - #22
Merged
Merged
Conversation
- Bug 1: lox weather — get_bytes now checks HTTP status; returns clean error instead of parsing 404 HTML response as binary data (caused astronomically wrong values like temp=9.65e+199, year=2067) - Bug 2: lox if — integer comparison now works: '200002700 == 200002700' correctly matches float value '200002700.000' by parsing both sides as f64 before comparing with == - Bug 3: lox if — [Room] qualifier in control name is now supported, consistent with 'lox get' and other commands - Bug 4: lox if — added --room flag for disambiguation, consistent with all other control commands (get, on, off, info, etc.) - Bug 5: lox time — now correctly reads 'Modified' attribute from /data/status endpoint; previously showed empty strings Also brings codebase up to v0.2.1 feature set (weather, time, globals, alias, dimmer, gate, color, thermostat, alarm, stats, history, music, reboot, files, extensions, discover commands)
Resolve merge conflicts keeping all bug fixes from the PR branch (weather parsing, if comparison, time display, room qualifier) while incorporating main's wording improvements. Add test cases for numeric string comparison edge cases (trailing zeros, large values). https://claude.ai/code/session_01Y6FK5kGHrFBXHEQUWCjKHF
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.
Bugs Fixed
Bug 1:
lox weather— Completely broken output (Kritisch)Root cause:
get_bytes()was not checking the HTTP status code. When/data/weatheru.binreturns 404, the HTML error response was parsed as binary weather data, producing absurd values (temperature = 9.65e+199, year = 2067, etc.).Fix:
get_bytes()now checks the HTTP status and returns a clean error for non-200 responses.Bug 2:
lox if— Integer comparison failsRoot cause:
eval_opused string equality for==and!=. So200002700.000 == 200002700was false.Fix:
eval_opnow parses both sides asf64for==/!=comparisons, falling back to string comparison for non-numeric values.Bug 3:
lox if—[Room]qualifier not supportedRoot cause:
Cmd::Ifusedfind_control()which doesn't support theName[Room]syntax.Fix: Now uses
resolve_with_room(), consistent withlox getand other commands.Bug 4:
lox if— Missing--roomflagAll other control commands support
--roomfor disambiguation.lox ifwas missing it.Fix: Added
--roomflag tolox if.Bug 5:
lox time— Empty outputRoot cause: Previous implementation queried wrong endpoints.
Fix: Now reads the
Modifiedattribute from/data/statuswhich is accessible to all users and contains the current Miniserver timestamp.Also brings the full v0.2.1 feature set into the repo (the source was behind the installed binary: weather, time, globals, alias, dimmer, gate, color, thermostat, alarm, stats, history, music, reboot, files, extensions, discover commands).