diff --git a/tests/common.py b/tests/common.py index faf14a55f01..a7d4cf6b83a 100644 --- a/tests/common.py +++ b/tests/common.py @@ -83,7 +83,7 @@ from homeassistant.helpers.dispatcher import ( from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.json import JSONEncoder, _orjson_default_encoder, json_dumps -from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType, StateType +from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from homeassistant.setup import setup_component from homeassistant.util.async_ import run_callback_threadsafe import homeassistant.util.dt as dt_util @@ -1291,11 +1291,6 @@ class MockEntity(entity.Entity): """Return the ste of the polling.""" return self._handle("should_poll") - @property - def state(self) -> StateType: - """Return the state of the entity.""" - return self._handle("state") - @property def supported_features(self) -> int | None: """Info about supported features.""" diff --git a/tests/helpers/test_entity_platform.py b/tests/helpers/test_entity_platform.py index 17b5d634018..31c6f8e6e30 100644 --- a/tests/helpers/test_entity_platform.py +++ b/tests/helpers/test_entity_platform.py @@ -1432,9 +1432,9 @@ async def test_override_restored_entities( component = EntityComponent(_LOGGER, DOMAIN, hass) await component.async_setup({}) - await component.async_add_entities( - [MockEntity(unique_id="1234", state="on", entity_id="test_domain.world")], True - ) + ent = MockEntity(unique_id="1234", entity_id="test_domain.world") + ent._attr_state = "on" + await component.async_add_entities([ent], True) state = hass.states.get("test_domain.world") assert state.state == "on"