Revbump to SoCo 0.13 and add support for Night Sound and Speech Enhancement. (#10765)
Sonos Playbar and Playbase devices support Night Sound and Speech Enhancement effects when playing from sources such as a TV. Adds a new service "sonos_set_option" whichs accepts boolean options to control these audio features.
This commit is contained in:
1 parent
024f1d4882
commit
dfb8b5a3c1
5 files changed
+85
-4
No files matched your search
@@ -389,3 +389,21 @@ class TestSonosMediaPlayer(unittest.TestCase):
|
||||
device.restore()
|
||||
self.assertEqual(restoreMock.call_count, 1)
|
||||
self.assertEqual(restoreMock.call_args, mock.call(False))
|
||||
|
||||
@mock.patch('soco.SoCo', new=SoCoMock)
|
||||
@mock.patch('socket.create_connection', side_effect=socket.error())
|
||||
def test_sonos_set_option(self, option_mock, *args):
|
||||
"""Ensuring soco methods called for sonos_set_option service."""
|
||||
sonos.setup_platform(self.hass, {}, fake_add_device, {
|
||||
'host': '192.0.2.1'
|
||||
})
|
||||
device = self.hass.data[sonos.DATA_SONOS][-1]
|
||||
device.hass = self.hass
|
||||
|
||||
option_mock.return_value = True
|
||||
device._snapshot_coordinator = mock.MagicMock()
|
||||
device._snapshot_coordinator.soco_device = SoCoMock('192.0.2.17')
|
||||
|
||||
device.update_option(night_sound=True, speech_enhance=True)
|
||||
|
||||
self.assertEqual(option_mock.call_count, 1)
|
||||
Reference in new issue
Block a user