From 3c8590355413332b16bdb4373547cc31aee81f56 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sun, 25 Jun 2023 02:38:59 +0100 Subject: [PATCH] renaem action_prop to action_fn --- vban_cmd/command.py | 7 +++---- vban_cmd/meta.py | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/vban_cmd/command.py b/vban_cmd/command.py index 5c77b62..b49c93a 100644 --- a/vban_cmd/command.py +++ b/vban_cmd/command.py @@ -1,5 +1,5 @@ from .iremote import IRemote -from .meta import action_prop +from .meta import action_fn class Command(IRemote): @@ -21,10 +21,9 @@ class Command(IRemote): (cls,), { **{ - param: action_prop(param) - for param in ["show", "shutdown", "restart"] + param: action_fn(param) for param in ["show", "shutdown", "restart"] }, - "hide": action_prop("show", val=0), + "hide": action_fn("show", val=0), }, ) return CMD_cls(remote) diff --git a/vban_cmd/meta.py b/vban_cmd/meta.py index d776b64..6973dee 100644 --- a/vban_cmd/meta.py +++ b/vban_cmd/meta.py @@ -16,7 +16,7 @@ def channel_bool_prop(param): )[self.index], "little", ) - & getattr(self._modes, f'_{param.replace(".", "_").lower()}') + & getattr(self._modes, f"_{param.lower()}") == 0 ) @@ -91,8 +91,8 @@ def bus_mode_prop(param): return property(fget, fset) -def action_prop(param, val=1): - """A param that performs an action""" +def action_fn(param, val=1): + """A function that performs an action""" def fdo(self): self.setter(param, val)