mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27: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 (
|
from tests.common import (
|
||||||
MockConfigEntry,
|
MockConfigEntry,
|
||||||
|
MockEntityPlatform,
|
||||||
MockUser,
|
MockUser,
|
||||||
async_capture_events,
|
async_capture_events,
|
||||||
async_mock_service,
|
async_mock_service,
|
||||||
@ -90,6 +91,8 @@ async def test_reload_core_conf(hass: HomeAssistant) -> None:
|
|||||||
ent = entity.Entity()
|
ent = entity.Entity()
|
||||||
ent.entity_id = "test.entity"
|
ent.entity_id = "test.entity"
|
||||||
ent.hass = hass
|
ent.hass = hass
|
||||||
|
platform = MockEntityPlatform(hass, domain="test", platform_name="test")
|
||||||
|
await platform.async_add_entities([ent])
|
||||||
ent.async_write_ha_state()
|
ent.async_write_ha_state()
|
||||||
|
|
||||||
state = hass.states.get("test.entity")
|
state = hass.states.get("test.entity")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user