clean code style

This commit is contained in:
Vadym Melnychuk 2023-07-24 18:02:00 +03:00
parent bab8bce804
commit 59943f1d4d

View File

@ -281,8 +281,7 @@ class HonAppliance:
self,
main: str,
target: Optional[List[str] | str] = None,
mandatory_only: bool = False,
target_parameters: Optional[List[str]] = None,
to_sync: Optional[List[str] | bool] = None,
) -> None:
base: Optional[HonCommand] = self.commands.get(main)
if not base:
@ -294,13 +293,11 @@ class HonAppliance:
for name, target_param in data.parameters.items():
if not (base_param := base.parameters.get(name)):
continue
if mandatory_only and not target_param.mandatory:
if to_sync and (
(isinstance(to_sync, list) and name not in to_sync)
or not target_param.mandatory
):
continue
if target_parameters and name not in target_parameters:
continue
self.sync_parameter(base_param, target_param)
def sync_parameter(self, main: Parameter, target: Parameter) -> None: