mirror of
https://github.com/Andre0512/pyhOn.git
synced 2025-05-15 07:34:26 -04:00
Improvements
This commit is contained in:
parent
44f40c531e
commit
0553e6c17d
8 changed files with 16 additions and 15 deletions
|
@ -106,7 +106,7 @@ class HonAppliance:
|
|||
@property
|
||||
def nick_name(self) -> str:
|
||||
result = self._check_name_zone("nickName")
|
||||
if not result or re.findall("^[xX\s]+$", result):
|
||||
if not result or re.findall("^[xX1\\s]+$", result):
|
||||
return self.model_name
|
||||
return result
|
||||
|
||||
|
@ -238,12 +238,12 @@ class HonAppliance:
|
|||
if not (command := self.commands.get(command_name)):
|
||||
return
|
||||
for key, value in self.attributes.get("parameters", {}).items():
|
||||
if isinstance(value, str) and (new := command.parameters.get(key)):
|
||||
if new := command.parameters.get(key):
|
||||
self.attributes["parameters"][key].update(
|
||||
str(new.intern_value), shield=True
|
||||
)
|
||||
|
||||
def sync_command(self, main: str, target: Optional[List[str]] = None) -> None:
|
||||
def sync_command(self, main: str, target: Optional[List[str] | str] = None) -> None:
|
||||
base: Optional[HonCommand] = self.commands.get(main)
|
||||
if not base:
|
||||
return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue