Improvements

This commit is contained in:
Andre Basche 2023-07-01 14:31:37 +02:00
parent 44f40c531e
commit 0553e6c17d
8 changed files with 16 additions and 15 deletions

View file

@ -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