mirror of
https://github.com/home-assistant/core.git
synced 2025-04-28 03:07:50 +00:00
Disable ESPHome assist_in_progress binary sensor (#125802)
This commit is contained in:
parent
b1a777a95a
commit
e89b258970
@ -74,6 +74,7 @@ class EsphomeAssistInProgressBinarySensor(EsphomeAssistEntity, BinarySensorEntit
|
|||||||
"""A binary sensor implementation for ESPHome for use with assist_pipeline."""
|
"""A binary sensor implementation for ESPHome for use with assist_pipeline."""
|
||||||
|
|
||||||
entity_description = BinarySensorEntityDescription(
|
entity_description = BinarySensorEntityDescription(
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
key="assist_in_progress",
|
key="assist_in_progress",
|
||||||
translation_key="assist_in_progress",
|
translation_key="assist_in_progress",
|
||||||
)
|
)
|
||||||
|
@ -15,12 +15,14 @@ import pytest
|
|||||||
from homeassistant.components.esphome import DomainData
|
from homeassistant.components.esphome import DomainData
|
||||||
from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNKNOWN
|
from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNKNOWN
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
from .conftest import MockESPHomeDevice
|
from .conftest import MockESPHomeDevice
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
|
||||||
async def test_assist_in_progress(
|
async def test_assist_in_progress(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
mock_voice_assistant_v1_entry,
|
mock_voice_assistant_v1_entry,
|
||||||
@ -44,6 +46,20 @@ async def test_assist_in_progress(
|
|||||||
assert state.state == "off"
|
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(
|
@pytest.mark.parametrize(
|
||||||
"binary_state", [(True, STATE_ON), (False, STATE_OFF), (None, STATE_UNKNOWN)]
|
"binary_state", [(True, STATE_ON), (False, STATE_OFF), (None, STATE_UNKNOWN)]
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user