mirror of
https://github.com/home-assistant/core.git
synced 2025-08-03 12:45:28 +02:00
Ensure entity platform in homeassistant tests (#135721)
This commit is contained in:
@@ -38,6 +38,7 @@ from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
MockEntityPlatform,
|
||||
MockUser,
|
||||
async_capture_events,
|
||||
async_mock_service,
|
||||
@@ -90,6 +91,8 @@ async def test_reload_core_conf(hass: HomeAssistant) -> None:
|
||||
ent = entity.Entity()
|
||||
ent.entity_id = "test.entity"
|
||||
ent.hass = hass
|
||||
platform = MockEntityPlatform(hass, domain="test", platform_name="test")
|
||||
await platform.async_add_entities([ent])
|
||||
ent.async_write_ha_state()
|
||||
|
||||
state = hass.states.get("test.entity")
|
||||
|
Reference in New Issue
Block a user