Disable voip call_in_progress binary sensor (#125812)
This commit is contained in:
parent
56031b2e1a
commit
662a30ffaf
2 changed files with 22 additions and 0 deletions
|
@ -42,6 +42,7 @@ class VoIPCallInProgress(VoIPEntity, BinarySensorEntity):
|
||||||
"""Entity to represent voip call is in progress."""
|
"""Entity to represent voip call is in progress."""
|
||||||
|
|
||||||
entity_description = BinarySensorEntityDescription(
|
entity_description = BinarySensorEntityDescription(
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
key="call_in_progress",
|
key="call_in_progress",
|
||||||
translation_key="call_in_progress",
|
translation_key="call_in_progress",
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
"""Test VoIP binary sensor devices."""
|
"""Test VoIP binary sensor devices."""
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components.voip.devices import VoIPDevice
|
from homeassistant.components.voip.devices import VoIPDevice
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
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(
|
async def test_call_in_progress(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
config_entry: ConfigEntry,
|
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")
|
state = hass.states.get("binary_sensor.192_168_1_210_call_in_progress")
|
||||||
assert state.state == "off"
|
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…
Add table
Add a link
Reference in a new issue