fix(panasonic): pass auto_power_on through to the change request builder - #507
Open
Tonttu84 wants to merge 1 commit into
Open
fix(panasonic): pass auto_power_on through to the change request builder#507Tonttu84 wants to merge 1 commit into
Tonttu84 wants to merge 1 commit into
Conversation
The option added in sockless-coding#495 has no effect: a settings write to a powered-off device still turns it on. `async_setup_panasonic` passes the option to `ApiClient`, but `PanasonicDeviceCoordinator.get_change_request_builder` constructs `ChangeRequestBuilder(self.device)` directly, which takes the class default `auto_power_on=True`. `_ensure_powered_on()` then adds `operate: On` to the request, which also defeats the buffering in `set_device_raw()` — that only buffers when the request is not turning the device on. `ApiClient.new_change_request(device)` exists for exactly this and carries the client's setting through. Verified on a CS-HZ25XKE with auto_power_on disabled: a setpoint write to an off unit now leaves it off and buffers the change, while an explicit hvac_mode command still powers it on and applies the buffered setpoint.
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.
2026.8.7added theauto_power_onoption (#495), but setting it tofalsehas no effect — a settings write to a powered-off unit still turns it on.panasonic/__init__.pypasses the option to the client correctly.PanasonicDeviceCoordinator.get_change_request_builderthen constructs its own builder without it:ChangeRequestBuilder.__init__defaults toauto_power_on=True, so_ensure_powered_on()addsoperate: Onto the request. That also defeats the other half of the design:set_device_raw()buffers a change for an off device unless the request is turning it on — and this one always is.ApiClientalready exposes the right factory:new_change_request(device), documented as "Create a ChangeRequestBuilder wired to this client's auto_power_on setting".Tested
On a real CS-HZ25XKE, integration
2026.8.7, withauto_power_on: falseset on the entry — not in the devcontainer:hvac_mode: heatThe third row is the one worth reviewing:
set_hvac_modeuses_force_powered_on(), so an explicit mode command still powers the unit on as intended. Only the implicit wake-on-settings-change is suppressed, which is what the option is for.Notes
new_change_requestis inaio-panasonic-comfort-cloud==2026.8.9, already pinned by the manifest.ChangeRequestBuilderimport stays in use as a type annotation.coordinator.pydoes not currently passblack --check, but that predates this change and black leaves this line alone, so the file is left otherwise untouched rather than reformatted in a one-line fix.This may also be relevant to #378 and #474, which describe a unit coming back on after being turned off — the comment on #378 identifies a setpoint write as the trigger. I haven't reproduced either reporter's setup, and neither is on a version carrying this option, so I'm not claiming to close them.