Add speaker settings: volume management, hardware controls, and LED controls#12
Add speaker settings: volume management, hardware controls, and LED controls#12danielpetrovic wants to merge 6 commits into
Conversation
354dd2b to
29fdaa1
Compare
|
Update — rebased onto latest This branch has been rebased onto upstream
The All setter methods in this PR use |
29fdaa1 to
1add09b
Compare
|
Update — rebased onto Rebased again onto your latest |
1add09b to
220df47
Compare
|
Update — branch rebased and expanded This branch has been rebased onto the latest upstream Add LSXII fw3.0 POST support, LSX2 alias, and raise_for_status
|
220df47 to
9751ca9
Compare
…ontrols Adds 48 new methods (24 sync + 24 async) across three areas: Volume management: - get/set_default_volume(input_source) — per-source startup volume - get_all_default_volumes() — all source defaults at once - get/set_volume_settings(max_volume, step, limit) - get/set_standby_volume_behavior(use_global) - get/set_startup_volume_enabled(enabled) Hardware settings: - get/set_standby_mode(mode) — standby timeout - get/set_startup_tone(enabled) — power-on chime - get/set_auto_switch_hdmi(enabled) - get/set_cable_mode(mode) - get/set_master_channel(channel) - get/set_wake_source(source) - get/set_subwoofer_wake_on_startup(enabled) - get/set_kw1_wake_on_startup(enabled) - get/set_usb_charging(enabled) - get/set_fixed_volume_mode(volume) - set_request(path, roles, value) — generic write counterpart to get_request() LED controls: - get/set_front_led(enabled) - get/set_standby_led(enabled) - get/set_top_panel_enabled(enabled) - get/set_top_panel_led(enabled) - get/set_top_panel_standby_led(enabled) All methods available in both KefConnector (sync) and KefAsyncConnector (async). Tested on LSX II, LSX II LT, and XIO hardware. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Document all 24 new methods added in this PR with usage examples: - Volume management: default volumes per source, volume settings, standby behavior - Hardware settings: standby mode, startup tone, HDMI, cable mode, wake source, LEDs - LED controls: front LED, standby LED, top panel enable/LED states Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace simple stubs with full documentation sections matching the detail level of the rest of the library: - Volume Management: per-input defaults, volume settings, reset volume, all-sources vs individual-sources mode, async examples - System Behavior Settings: standby mode, wake source, HDMI auto-switch, startup tone, USB charging, cable mode, master channel, async examples - Do Not Disturb Settings: standby LED, startup tone, XIO control panel LEDs (front LED, top panel enable/standby), async examples Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add "LSXII" to _POST_MODELS so fw3.0 setData calls use POST instead of GET (which returns 405 on fw3.0). Supersedes PR N0ciple#16. - Add "LSX2" → "LSXII" to _MODEL_ALIASES so older firmware or API responses using the legacy name still resolve correctly - Add raise_for_status() before every response.json() call so HTTP errors surface instead of being silently swallowed, based on leccelecce's work in N0ciple#15 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
hass-kef-connector uses "LS60Wireless" as the model key (matching the product name). Without this alias, LS60 owners using hass-kef-connector PR N0ciple#17 would fall back to GET-based setData and hit 405 errors with firmware 4.0+.
9751ca9 to
3350eed
Compare
|
Update — rebased onto 0.9.3 + LS60Wireless alias Rebased onto upstream
|
XIO firmware 1.4.135 switched setData from GET to POST. LS60 firmware renamed the model ID from "LS60" to "LS60W" (fixes upstream issue N0ciple#18). Changes: - Add "XIO" and "LS60W" to _POST_MODELS - Remove "LS60" from _POST_MODELS (no longer the active model ID) - Add "LS60": "LS60W" alias for backward compat with older LS60 firmware - Add "LS60Wireless": "LS60W" alias for integrations using the product name
|
Update — XIO and LS60W POST support added Following up on the LS60Wireless alias added in the previous update:
These same fixes are also available as a standalone PR (#19) if a faster targeted merge is preferred. |
This PR adds 48 new methods (24 sync + 24 async) covering three related areas of speaker configuration that are currently missing from the library. All methods have been tested on LSX II, LSX II LT, and XIO hardware.
Volume Management (9 sync + 9 async)
Per-source default volumes and global volume settings:
get_default_volume(input_source)/set_default_volume(input_source, volume)— per-source startup volume (wifi, bluetooth, optical, coaxial, usb, analogue, tv)get_all_default_volumes()— retrieve default volumes for all sources at onceget_volume_settings()/set_volume_settings(max_volume, step, limit)— max volume cap, step size, and limitget_standby_volume_behavior()/set_standby_volume_behavior(use_global)— whether standby resumes at global or per-source volumeget_startup_volume_enabled()/set_startup_volume_enabled(enabled)— startup volume overrideHardware Settings (11 sync + 11 async)
Speaker behaviour and connectivity settings:
get_standby_mode()/set_standby_mode(mode)— standby timeout (off/20min/60min)get_startup_tone()/set_startup_tone(enabled)— power-on chimeget_auto_switch_hdmi()/set_auto_switch_hdmi(enabled)— HDMI auto-source switchingget_cable_mode()/set_cable_mode(mode)— wired connection modeget_master_channel()/set_master_channel(channel)— left/right master assignmentget_wake_source()/set_wake_source(source)— which input wakes the speakerget_subwoofer_wake_on_startup()/set_subwoofer_wake_on_startup(enabled)— subwoofer auto-wakeget_kw1_wake_on_startup()/set_kw1_wake_on_startup(enabled)— KW1 wireless sub auto-wakeget_usb_charging()/set_usb_charging(enabled)— USB port chargingget_fixed_volume_mode()/set_fixed_volume_mode(volume)— fixed output level for AV receiversset_request(path, roles, value)— generic write counterpart to the existingget_request()LED Controls (5 sync + 5 async)
Visual indicator management:
get_front_led()/set_front_led(enabled)— front logo LEDget_standby_led()/set_standby_led(enabled)— standby indicator LEDget_top_panel_enabled()/set_top_panel_enabled(enabled)— top touch panelget_top_panel_led()/set_top_panel_led(enabled)— top panel LED in active stateget_top_panel_standby_led()/set_top_panel_standby_led(enabled)— top panel LED in standbyNotes
requests, async usesaiohttp)set_request()mirrors the existingget_request()signature for consistencyWhat's Coming Next
This is the first in a series of focused PRs. The full set of new endpoints was discovered by decompiling the KEF Connect Android APK (v1.26.1) using JADX, which gave us a definitive list of all 209 KEF API paths from
ApiPath.java. Subsequent PRs will cover:get_eq_profile/set_eq_profile, desk mode, wall mode, bass extension, treble, balance, phase correctionThe goal is to eventually have complete API coverage in pykefcontrol, which will enable a much richer hass-kef-connector integration with full speaker configuration from Home Assistant.