mirror of
https://github.com/onyx-and-iris/vban-cmd-python.git
synced 2026-04-18 04:53:31 +00:00
initial commit
initial commit
This commit is contained in:
12
vban_cmd/meta.py
Normal file
12
vban_cmd/meta.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from .errors import VMCMDErrors
|
||||
|
||||
def strip_output_prop(param):
|
||||
""" A channel prop. """
|
||||
def fget(self):
|
||||
data = self.getter()
|
||||
return not int.from_bytes(data.stripstate[self.index], 'little') & getattr(self._modes, f'_bus{param.lower()}') == 0
|
||||
def fset(self, val):
|
||||
if not isinstance(val, bool) and val not in (0, 1):
|
||||
raise VMCMDErrors(f'{param} is a boolean parameter')
|
||||
self.setter(param, 1 if val else 0)
|
||||
return property(fget, fset)
|
||||
Reference in New Issue
Block a user