mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-15 07:34:26 -04:00
Expose settings
This commit is contained in:
parent
984d1b91b7
commit
3efa2fd3f5
5 changed files with 105 additions and 15 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue