mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-18 17:14:35 -04:00
Add rule handling
This commit is contained in:
parent
9971fe95e2
commit
c2765fe953
10 changed files with 133 additions and 10 deletions
|
@ -106,8 +106,8 @@ class HonAppliance:
|
|||
return serial_number[:8] if len(serial_number) < 18 else serial_number[:11]
|
||||
|
||||
@property
|
||||
def commands_options(self):
|
||||
return self._appliance_model.get("options")
|
||||
def options(self):
|
||||
return self._appliance_model.get("options", {})
|
||||
|
||||
@property
|
||||
def commands(self):
|
||||
|
@ -287,7 +287,10 @@ class HonAppliance:
|
|||
data.get("appliance", {}).pop(sensible, None)
|
||||
result = helper.pretty_print({"data": data}, whitespace=whitespace)
|
||||
result += helper.pretty_print(
|
||||
{"commands": helper.create_command(self.commands)},
|
||||
{
|
||||
"commands": helper.create_command(self.commands),
|
||||
"rules": helper.create_rules(self.commands),
|
||||
},
|
||||
whitespace=whitespace,
|
||||
)
|
||||
return result.replace(self.mac_address, "xx-xx-xx-xx-xx-xx")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue