diff --git a/homeassistant/components/esphome/binary_sensor.py b/homeassistant/components/esphome/binary_sensor.py index 32d96785601..0f404445486 100644 --- a/homeassistant/components/esphome/binary_sensor.py +++ b/homeassistant/components/esphome/binary_sensor.py @@ -74,6 +74,7 @@ class EsphomeAssistInProgressBinarySensor(EsphomeAssistEntity, BinarySensorEntit """A binary sensor implementation for ESPHome for use with assist_pipeline.""" entity_description = BinarySensorEntityDescription( + entity_registry_enabled_default=False, key="assist_in_progress", translation_key="assist_in_progress", ) diff --git a/tests/components/esphome/test_binary_sensor.py b/tests/components/esphome/test_binary_sensor.py index 3da8a54ff34..a28e55de87f 100644 --- a/tests/components/esphome/test_binary_sensor.py +++ b/tests/components/esphome/test_binary_sensor.py @@ -15,12 +15,14 @@ import pytest from homeassistant.components.esphome import DomainData from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNKNOWN from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er from .conftest import MockESPHomeDevice from tests.common import MockConfigEntry +@pytest.mark.usefixtures("entity_registry_enabled_by_default") async def test_assist_in_progress( hass: HomeAssistant, mock_voice_assistant_v1_entry, @@ -44,6 +46,20 @@ async def test_assist_in_progress( assert state.state == "off" +async def test_assist_in_progress_disabled_by_default( + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + mock_voice_assistant_v1_entry, +) -> None: + """Test assist in progress binary sensor is added disabled.""" + + assert not hass.states.get("binary_sensor.test_assist_in_progress") + entity_entry = entity_registry.async_get("binary_sensor.test_assist_in_progress") + assert entity_entry + assert entity_entry.disabled + assert entity_entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION + + @pytest.mark.parametrize( "binary_state", [(True, STATE_ON), (False, STATE_OFF), (None, STATE_UNKNOWN)] )