fix(bravia_pro): power boolean param, numeric volume parse, error-body handling - #2
Draft
kvu-ucla wants to merge 1 commit into
Draft
fix(bravia_pro): power boolean param, numeric volume parse, error-body handling#2kvu-ucla wants to merge 1 commit into
kvu-ucla wants to merge 1 commit into
Conversation
…y handling
Verified against a live FW-43BZ30L (Pro mode, interface 5.7.0):
- setPowerStatus takes a boolean; the "active"/"standby" strings were
rejected with [3, "Illegal Argument"] so power control never worked
- getVolumeInformation returns volume as a JSON number, the as_s parse
raised TypeCastError; now accepts number with string fallback
- the display reports failures as HTTP 200 with an {"error": [code, msg]}
body; commands no longer set state optimistically when rejected
(e.g. 40005 "Display Is Turned off" while in standby)
- expected standby/no-content errors (7, 40005) log at debug, not warn
- dedupe volume?/mute? via shared speaker_info; fix `.hdmi?` matcher typo
Spec updated to mirror real hardware payloads and cover the error paths.
kvu-ucla
force-pushed
the
worktree-bravia-pro-fixes
branch
from
August 21, 2026 21:37
1b32f3b to
395459f
Compare
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
Fixes three bugs in the Sony Bravia Pro REST driver, all found and verified against a live FW-43BZ30L (Pro mode, interface 5.7.0) in nonprod:
setPowerStatustakes a boolean{"status": true}; the driver sent"active"/"standby"strings, which the display rejects with[3, "Illegal Argument"]. Those strings are only the response vocabulary ofgetPowerStatus."volume": 17as a JSON number, but the driver parsed with.as_s.to_i?, raisingTypeCastError. Now parses numbers with a string fallback for older firmware. (Note: the sent volume must stay a string — integers are rejected.){"error": [code, msg]}in the body (e.g.40005 "Display Is Turned off"in standby). The driver only checkedresponse.success?, so rejected commands still updated state. A sharedparse_resulthelper now checks the body; expected standby/no-content errors (7, 40005) log at debug instead of warn.Also dedupes
volume?/mute?through a sharedspeaker_infolookup and fixes thewhen .hdmi1?, hdmi?matcher typo (missing dot).Testing
maxVolume/minVolumefields) and adds error-path coverage: rejected commands must not update state.crystal spec drivers/sony/displays/bravia_pro_spec.crpasses against a-Dplaceos_all_transportsbuild.🤖 Generated with Claude Code