aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pyagl/services/audiomixer.py4
-rw-r--r--pyagl/tests/test_audiomixer.py18
2 files changed, 20 insertions, 2 deletions
diff --git a/pyagl/services/audiomixer.py b/pyagl/services/audiomixer.py
index fa9a7fd..41db856 100644
--- a/pyagl/services/audiomixer.py
+++ b/pyagl/services/audiomixer.py
@@ -33,10 +33,10 @@ class AudioMixerService(AGLBaseService):
def __init__(self, ip, port=None, service='agl-service-audiomixer'):
super().__init__(api='audiomixer', ip=ip, port=port, service=service)
- async def subscribe(self, event='volume_changed'): # audio mixer uses 'event' instead 'value',
+ async def subscribe(self, event=None): # audio mixer uses 'event' instead 'value',
return await self.request('subscribe', {'event': event})
- async def unsubscribe(self, event='volume_changed'):
+ async def unsubscribe(self, event=None):
return await self.request('unsubscribe', {'event': event})
async def list_controls(self):
diff --git a/pyagl/tests/test_audiomixer.py b/pyagl/tests/test_audiomixer.py
index 5f9b7d0..2349486 100644
--- a/pyagl/tests/test_audiomixer.py
+++ b/pyagl/tests/test_audiomixer.py
@@ -101,3 +101,21 @@ async def test_set_unmute(event_loop, service: AMS):
assert msgid == resp.msgid
assert resp.type == AFBT.RESPONSE
assert resp.status == 'success'
+
+
+@pytest.mark.audiomixer
+async def test_subscribe(event_loop,service: AMS):
+ msgid = await service.subscribe('volume_changed')
+ resp = await service.afbresponse()
+ assert msgid == resp.msgid
+ assert resp.type == AFBT.RESPONSE
+ assert resp.status == 'success'
+
+
+@pytest.mark.audiomixer
+async def test_unsubscribe(event_loop,service: AMS):
+ msgid = await service.unsubscribe('volume_changed')
+ resp = await service.afbresponse()
+ assert msgid == resp.msgid
+ assert resp.type == AFBT.RESPONSE
+ assert resp.status == 'success'