From 26bc35c8a632d72d35a3aeb5bb0c93b5ca6546b7 Mon Sep 17 00:00:00 2001 From: Andre Basche Date: Sat, 1 Jul 2023 16:27:50 +0200 Subject: [PATCH] Fix issue in locking attribute updates --- pyhon/appliance.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyhon/appliance.py b/pyhon/appliance.py index 3e79192..40c2947 100644 --- a/pyhon/appliance.py +++ b/pyhon/appliance.py @@ -169,9 +169,9 @@ class HonAppliance: self.sync_params_to_command("settings") async def load_attributes(self) -> None: - self._attributes = await self.api.load_attributes(self) + attributes = await self.api.load_attributes(self) for name, values in ( - self._attributes.pop("shadow", {}).get("parameters", {}).items() + attributes.pop("shadow", {}).get("parameters", {}).items() ): if name in self._attributes.get("parameters", {}): self._attributes["parameters"][name].update(values) @@ -179,6 +179,7 @@ class HonAppliance: self._attributes.setdefault("parameters", {})[name] = HonAttribute( values ) + self._attributes |= attributes if self._extra: self._attributes = self._extra.attributes(self._attributes)