Add support for Sonos subwoofer gain controls (#68334)
This commit is contained in:
parent
7174e7897c
commit
dbb79e2937
4 changed files with 19 additions and 3 deletions
|
@ -6,8 +6,8 @@ from homeassistant.const import ATTR_ENTITY_ID
|
|||
from homeassistant.helpers import entity_registry as ent_reg
|
||||
|
||||
|
||||
async def test_audio_input_sensor(hass, async_autosetup_sonos, soco):
|
||||
"""Test audio input sensor."""
|
||||
async def test_number_entities(hass, async_autosetup_sonos, soco):
|
||||
"""Test number entities."""
|
||||
entity_registry = ent_reg.async_get(hass)
|
||||
|
||||
bass_number = entity_registry.entities["number.zone_a_bass"]
|
||||
|
@ -30,3 +30,16 @@ async def test_audio_input_sensor(hass, async_autosetup_sonos, soco):
|
|||
blocking=True,
|
||||
)
|
||||
assert mock_audio_delay.called_with(3)
|
||||
|
||||
sub_gain_number = entity_registry.entities["number.zone_a_sub_gain"]
|
||||
sub_gain_state = hass.states.get(sub_gain_number.entity_id)
|
||||
assert sub_gain_state.state == "5"
|
||||
|
||||
with patch("soco.SoCo.sub_gain") as mock_sub_gain:
|
||||
await hass.services.async_call(
|
||||
NUMBER_DOMAIN,
|
||||
SERVICE_SET_VALUE,
|
||||
{ATTR_ENTITY_ID: sub_gain_number.entity_id, "value": -8},
|
||||
blocking=True,
|
||||
)
|
||||
assert mock_sub_gain.called_with(-8)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue