mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Always setup demo platforms with device support from config entry (#94586)
* Always setup demo platforms with device support from config entry * Adjust test fixutres * Update tests depending on the demo integration
This commit is contained in:
@@ -5,6 +5,7 @@ import pytest
|
||||
|
||||
from homeassistant.components import camera
|
||||
from homeassistant.components.camera.const import StreamType
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
@@ -17,6 +18,16 @@ async def setup_homeassistant(hass: HomeAssistant):
|
||||
await async_setup_component(hass, "homeassistant", {})
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
async def camera_only() -> None:
|
||||
"""Enable only the camera platform."""
|
||||
with patch(
|
||||
"homeassistant.components.demo.COMPONENTS_WITH_CONFIG_ENTRY_DEMO_PLATFORM",
|
||||
[Platform.CAMERA],
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture(name="mock_camera")
|
||||
async def mock_camera_fixture(hass):
|
||||
"""Initialize a demo camera platform."""
|
||||
|
||||
Reference in New Issue
Block a user