mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Ensure entity platform in homeassistant tests (#135721)
This commit is contained in:
parent
7430238c0a
commit
6aed2dcc0f
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user