From 662a30ffaf82d343323e079d12ab2bdb321805af Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 12 Sep 2024 20:34:11 +0200 Subject: [PATCH] Disable voip call_in_progress binary sensor (#125812) --- .../components/voip/binary_sensor.py | 1 + tests/components/voip/test_binary_sensor.py | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/homeassistant/components/voip/binary_sensor.py b/homeassistant/components/voip/binary_sensor.py index 121de507d7b..a1ef36a7086 100644 --- a/homeassistant/components/voip/binary_sensor.py +++ b/homeassistant/components/voip/binary_sensor.py @@ -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", ) diff --git a/tests/components/voip/test_binary_sensor.py b/tests/components/voip/test_binary_sensor.py index 58f1e0ea53b..50a8c5d4141 100644 --- a/tests/components/voip/test_binary_sensor.py +++ b/tests/components/voip/test_binary_sensor.py @@ -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