Skip to content

Commit

Permalink
Fix issue in locking attribute updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre0512 committed Jul 1, 2023
1 parent 17d73cd commit 26bc35c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyhon/appliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,17 @@ async def load_commands(self) -> None:
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)
else:
self._attributes.setdefault("parameters", {})[name] = HonAttribute(
values
)
self._attributes |= attributes
if self._extra:
self._attributes = self._extra.attributes(self._attributes)

Expand Down

0 comments on commit 26bc35c

Please sign in to comment.