diff --git a/homeassistant/components/wyoming/binary_sensor.py b/homeassistant/components/wyoming/binary_sensor.py index 4f2c0bb170a..ac5db0cda99 100644 --- a/homeassistant/components/wyoming/binary_sensor.py +++ b/homeassistant/components/wyoming/binary_sensor.py @@ -37,6 +37,7 @@ class WyomingSatelliteAssistInProgress(WyomingSatelliteEntity, BinarySensorEntit """Entity to represent Assist is in progress for satellite.""" entity_description = BinarySensorEntityDescription( + entity_registry_enabled_default=False, key="assist_in_progress", translation_key="assist_in_progress", ) diff --git a/tests/components/wyoming/test_binary_sensor.py b/tests/components/wyoming/test_binary_sensor.py index 8d4e3c72c56..99ed5cda58e 100644 --- a/tests/components/wyoming/test_binary_sensor.py +++ b/tests/components/wyoming/test_binary_sensor.py @@ -1,13 +1,17 @@ """Test Wyoming binary sensor devices.""" +import pytest + from homeassistant.components.wyoming.devices import SatelliteDevice from homeassistant.config_entries import ConfigEntry from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er from . import reload_satellite +@pytest.mark.usefixtures("entity_registry_enabled_by_default") async def test_assist_in_progress( hass: HomeAssistant, satellite_config_entry: ConfigEntry, @@ -36,3 +40,19 @@ async def test_assist_in_progress( assert state is not None assert state.state == STATE_OFF assert not satellite_device.is_active + + +async def test_assist_in_progress_disabled_by_default( + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + satellite_device: SatelliteDevice, +) -> None: + """Test assist in progress binary sensor is added disabled.""" + assist_in_progress_id = satellite_device.get_assist_in_progress_entity_id(hass) + assert assist_in_progress_id + + assert not hass.states.get(assist_in_progress_id) + entity_entry = entity_registry.async_get(assist_in_progress_id) + assert entity_entry + assert entity_entry.disabled + assert entity_entry.disabled_by is er.RegistryEntryDisabler.INTEGRATION diff --git a/tests/components/wyoming/test_devices.py b/tests/components/wyoming/test_devices.py index 98efb76ab1d..24423264f93 100644 --- a/tests/components/wyoming/test_devices.py +++ b/tests/components/wyoming/test_devices.py @@ -32,8 +32,8 @@ async def test_device_registry_info( assist_in_progress_id = satellite_device.get_assist_in_progress_entity_id(hass) assert assist_in_progress_id assist_in_progress_state = hass.states.get(assist_in_progress_id) - assert assist_in_progress_state is not None - assert assist_in_progress_state.state == STATE_OFF + # assist_in_progress binary sensor is disabled + assert assist_in_progress_state is None muted_id = satellite_device.get_muted_entity_id(hass) assert muted_id @@ -58,7 +58,8 @@ async def test_remove_device_registry_entry( # Check associated entities assist_in_progress_id = satellite_device.get_assist_in_progress_entity_id(hass) assert assist_in_progress_id - assert hass.states.get(assist_in_progress_id) is not None + # assist_in_progress binary sensor is disabled + assert hass.states.get(assist_in_progress_id) is None muted_id = satellite_device.get_muted_entity_id(hass) assert muted_id