1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Enable fallback polling for Sonos microphone binary_sensor (#66299)

This commit is contained in:
jjlawren
2022-02-21 12:46:20 -06:00
committed by GitHub
parent 3644740786
commit 76149876ab
4 changed files with 18 additions and 3 deletions

View File

@@ -165,13 +165,16 @@ async def test_microphone_binary_sensor(
):
"""Test microphone binary sensor."""
entity_registry = ent_reg.async_get(hass)
assert "binary_sensor.zone_a_microphone" not in entity_registry.entities
assert "binary_sensor.zone_a_microphone" in entity_registry.entities
mic_binary_sensor = entity_registry.entities["binary_sensor.zone_a_microphone"]
mic_binary_sensor_state = hass.states.get(mic_binary_sensor.entity_id)
assert mic_binary_sensor_state.state == STATE_OFF
# Update the speaker with a callback event
subscription = soco.deviceProperties.subscribe.return_value
subscription.callback(device_properties_event)
await hass.async_block_till_done()
mic_binary_sensor = entity_registry.entities["binary_sensor.zone_a_microphone"]
mic_binary_sensor_state = hass.states.get(mic_binary_sensor.entity_id)
assert mic_binary_sensor_state.state == STATE_ON