mirror of
https://github.com/home-assistant/core.git
synced 2025-07-30 02:38:10 +02:00
Speed up mqtt tests (#73423)
Co-authored-by: jbouwh <jan@jbsoft.nl> Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
This commit is contained in:
@ -15,6 +15,7 @@ from homeassistant.const import (
|
||||
STATE_OFF,
|
||||
STATE_ON,
|
||||
STATE_UNKNOWN,
|
||||
Platform,
|
||||
)
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
@ -55,6 +56,13 @@ DEFAULT_CONFIG = {
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def siren_platform_only():
|
||||
"""Only setup the siren platform to speed up tests."""
|
||||
with patch("homeassistant.components.mqtt.PLATFORMS", [Platform.SIREN]):
|
||||
yield
|
||||
|
||||
|
||||
async def async_turn_on(hass, entity_id=ENTITY_MATCH_ALL, parameters={}) -> None:
|
||||
"""Turn all or specified siren on."""
|
||||
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
|
||||
|
Reference in New Issue
Block a user