Set Entity._platform_state in core customize test (#147895)

This commit is contained in:
Erik Montnemery 2025-07-01 21:45:08 +02:00 committed by GitHub
parent 78a9cd9201
commit 1195c2ec10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,7 +38,7 @@ from homeassistant.core_config import (
async_process_ha_core_config,
)
from homeassistant.helpers import issue_registry as ir
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity import Entity, EntityPlatformState
from homeassistant.util.unit_system import (
METRIC_SYSTEM,
US_CUSTOMARY_SYSTEM,
@ -222,6 +222,7 @@ async def _compute_state(hass: HomeAssistant, config: dict[str, Any]) -> State |
entity.entity_id = "test.test"
entity.hass = hass
entity.platform = MockEntityPlatform(hass)
entity._platform_state = EntityPlatformState.ADDED
entity.schedule_update_ha_state()
await hass.async_block_till_done()