Disable voip call_in_progress binary sensor (#125812)
parent
56031b2e1a
commit
662a30ffaf
|
@ -42,6 +42,7 @@ class VoIPCallInProgress(VoIPEntity, BinarySensorEntity):
|
|||
"""Entity to represent voip call is in progress."""
|
||||
|
||||
entity_description = BinarySensorEntityDescription(
|
||||
entity_registry_enabled_default=False,
|
||||
key="call_in_progress",
|
||||
translation_key="call_in_progress",
|
||||
)
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
"""Test VoIP binary sensor devices."""
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.components.voip.devices import VoIPDevice
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
|
||||
async def test_call_in_progress(
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
|
@ -24,3 +28,20 @@ async def test_call_in_progress(
|
|||
|
||||
state = hass.states.get("binary_sensor.192_168_1_210_call_in_progress")
|
||||
assert state.state == "off"
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("voip_device")
|
||||
async def test_assist_in_progress_disabled_by_default(
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
entity_registry: er.EntityRegistry,
|
||||
) -> None:
|
||||
"""Test assist in progress binary sensor is added disabled."""
|
||||
|
||||
assert not hass.states.get("binary_sensor.192_168_1_210_call_in_progress")
|
||||
entity_entry = entity_registry.async_get(
|
||||
"binary_sensor.192_168_1_210_call_in_progress"
|
||||
)
|
||||
assert entity_entry
|
||||
assert entity_entry.disabled
|
||||
assert entity_entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION
|
||||
|
|
Loading…
Reference in New Issue