Fix issue in locking attribute updates

This commit is contained in:
Andre Basche 2023-07-01 16:27:50 +02:00
parent 17d73cdeb8
commit 26bc35c8a6

View file

@ -169,9 +169,9 @@ class HonAppliance:
self.sync_params_to_command("settings") self.sync_params_to_command("settings")
async def load_attributes(self) -> None: 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 ( for name, values in (
self._attributes.pop("shadow", {}).get("parameters", {}).items() attributes.pop("shadow", {}).get("parameters", {}).items()
): ):
if name in self._attributes.get("parameters", {}): if name in self._attributes.get("parameters", {}):
self._attributes["parameters"][name].update(values) self._attributes["parameters"][name].update(values)
@ -179,6 +179,7 @@ class HonAppliance:
self._attributes.setdefault("parameters", {})[name] = HonAttribute( self._attributes.setdefault("parameters", {})[name] = HonAttribute(
values values
) )
self._attributes |= attributes
if self._extra: if self._extra:
self._attributes = self._extra.attributes(self._attributes) self._attributes = self._extra.attributes(self._attributes)