Expose settings

This commit is contained in:
Andre Basche 2023-02-18 22:25:51 +01:00
parent 984d1b91b7
commit 3efa2fd3f5
5 changed files with 105 additions and 15 deletions

View file

@ -135,11 +135,18 @@ class HonDevice:
elif "parameters" in attr[list(attr)[0]]:
multi = {}
for category, attr2 in attr.items():
cmd = HonCommand(command, attr2, self._connector, self, multi=multi)
cmd = HonCommand(command, attr2, self._connector, self, multi=multi, category=category)
multi[category] = cmd
commands[command] = cmd
self._commands = commands
@property
def settings(self):
result = {}
for command in self._commands.values():
result |= command.settings
return result
async def load_attributes(self):
data = await self._connector.load_attributes(self)
for name, values in data.get("shadow").get("parameters").items():