mute prop added to dca class

mute tests added

patch bump
This commit is contained in:
onyx-and-iris 2022-11-10 12:10:01 +00:00
parent e7d38bb9d7
commit a09b07e1c2
4 changed files with 43 additions and 1 deletions

View File

@ -1,6 +1,6 @@
[tool.poetry] [tool.poetry]
name = "xair-api" name = "xair-api"
version = "2.2.0" version = "2.2.1"
description = "Remote control Behringer X-Air | Midas MR mixers through OSC" description = "Remote control Behringer X-Air | Midas MR mixers through OSC"
authors = ["onyx-and-iris <code@onyxandiris.online>"] authors = ["onyx-and-iris <code@onyxandiris.online>"]
license = "MIT" license = "MIT"

View File

@ -5,6 +5,23 @@ from tests.x32 import data, tests
""" STRIP TESTS """ """ STRIP TESTS """
class TestSetAndGetStripMuteHigher:
"""Mute"""
__test__ = True
def setup_class(self):
self.target = getattr(tests, "strip")[data.strip]
@pytest.mark.parametrize(
"param,value",
[("mute", True), ("mute", False)],
)
def test_it_sets_and_gets_strip_mute_bool_params(self, param, value):
setattr(self.target, param, value)
assert getattr(self.target, param) == value
class TestSetAndGetStripMixHigher: class TestSetAndGetStripMixHigher:
"""Mix""" """Mix"""

View File

@ -106,6 +106,23 @@ class TestSetAndGetLRGEQHigher:
""" STRIP TESTS """ """ STRIP TESTS """
class TestSetAndGetStripMuteHigher:
"""Mute"""
__test__ = True
def setup_class(self):
self.target = getattr(tests, "strip")[data.strip]
@pytest.mark.parametrize(
"param,value",
[("mute", True), ("mute", False)],
)
def test_it_sets_and_gets_strip_mute_bool_params(self, param, value):
setattr(self.target, param, value)
assert getattr(self.target, param) == value
class TestSetAndGetStripMixHigher: class TestSetAndGetStripMixHigher:
"""Mix""" """Mix"""

View File

@ -37,6 +37,14 @@ class DCA(IDCA):
def on(self, val: bool): def on(self, val: bool):
self.setter("on", 1 if val else 0) self.setter("on", 1 if val else 0)
@property
def mute(self) -> bool:
return not self.on
@mute.setter
def mute(self, val: bool):
self.on = not val
@property @property
def name(self) -> str: def name(self) -> str:
return self.getter("config/name")[0] return self.getter("config/name")[0]