mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Set Entity._platform_state in core customize test (#147895)
This commit is contained in:
parent
78a9cd9201
commit
1195c2ec10
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user