Ensure entity platform in homeassistant tests (#135721)

This commit is contained in:
G Johansson 2025-01-17 09:11:07 +01:00 committed by GitHub
parent 7430238c0a
commit 6aed2dcc0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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")