From 4d29484d61a73027ff4bbe1ea3bf2088af3f25b8 Mon Sep 17 00:00:00 2001 From: Peter Boucher Date: Mon, 3 Aug 2026 14:23:16 +0200 Subject: [PATCH] Moved cache write after the API request and error checking to ensure positive result before recording the new state of the device --- pyhon/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyhon/commands.py b/pyhon/commands.py index facf419..5400c3a 100644 --- a/pyhon/commands.py +++ b/pyhon/commands.py @@ -144,7 +144,6 @@ class HonCommand: ancillary_params.pop("programRules", None) if "prStr" in params: params["prStr"] = self._category_name.upper() - self.appliance.sync_command_to_params(self.name) try: result = await self.api.send_command( self._appliance, @@ -156,6 +155,7 @@ class HonCommand: if not result: _LOGGER.error(result) raise ApiError("Can't send command") + self.appliance.sync_command_to_params(self.name) except NoAuthenticationException: _LOGGER.error("No Authentication") return False