Disable ESPHome assist_in_progress binary sensor (#125802)
This commit is contained in:
parent
b1a777a95a
commit
e89b258970
2 changed files with 17 additions and 0 deletions
|
@ -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",
|
||||
)
|
||||
|
|
|
@ -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)]
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue