From 48a095c75620be18af661fd554c7d14dda457c3f Mon Sep 17 00:00:00 2001 From: Tonttu84 Date: Tue, 25 Aug 2026 19:35:17 +0300 Subject: [PATCH] fix(panasonic): pass auto_power_on through to the change request builder MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The option added in #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. --- custom_components/panasonic_cc/panasonic/coordinator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/panasonic_cc/panasonic/coordinator.py b/custom_components/panasonic_cc/panasonic/coordinator.py index cde2d6c..9405d05 100644 --- a/custom_components/panasonic_cc/panasonic/coordinator.py +++ b/custom_components/panasonic_cc/panasonic/coordinator.py @@ -136,7 +136,7 @@ def device_info(self) -> DeviceInfo: def get_change_request_builder(self) -> ChangeRequestBuilder: """Get a change request builder for the current device.""" - return ChangeRequestBuilder(self.device) + return self._api_client.new_change_request(self.device) async def async_apply_changes(self, request_builder: ChangeRequestBuilder) -> None: """Apply changes to the device."""