@@ -64,6 +64,15 @@ class CoordinatorEntity:
6464 def __init__ (self , coordinator ):
6565 self .coordinator = coordinator
6666
67+ async def async_added_to_hass (self ):
68+ return None
69+
70+ def async_on_remove (self , _remove_callback ):
71+ return None
72+
73+ def async_write_ha_state (self ):
74+ return None
75+
6776 class SensorEntity :
6877 @property
6978 def native_unit_of_measurement (self ):
@@ -77,6 +86,9 @@ class SensorDeviceClass:
7786 class HomeAssistant :
7887 pass
7988
89+ def callback (func ):
90+ return func
91+
8092 class DeviceEntryType :
8193 SERVICE = "service"
8294
@@ -99,7 +111,7 @@ def __init__(self, url_path, path, cache_headers=True):
99111 FlowResult = FlowResult ,
100112 ),
101113 "homeassistant.data_entry_flow" : _make_module ("homeassistant.data_entry_flow" , FlowResult = FlowResult ),
102- "homeassistant.core" : _make_module ("homeassistant.core" , HomeAssistant = HomeAssistant ),
114+ "homeassistant.core" : _make_module ("homeassistant.core" , HomeAssistant = HomeAssistant , callback = callback ),
103115 "homeassistant.helpers" : _make_module ("homeassistant.helpers" ),
104116 "homeassistant.helpers.update_coordinator" : _make_module (
105117 "homeassistant.helpers.update_coordinator" ,
@@ -108,6 +120,10 @@ def __init__(self, url_path, path, cache_headers=True):
108120 CoordinatorEntity = CoordinatorEntity ,
109121 ),
110122 "homeassistant.helpers.entity_platform" : _make_module ("homeassistant.helpers.entity_platform" , AddEntitiesCallback = MagicMock ()),
123+ "homeassistant.helpers.event" : _make_module (
124+ "homeassistant.helpers.event" ,
125+ async_track_time_interval = MagicMock (return_value = lambda : None ),
126+ ),
111127 "homeassistant.helpers.aiohttp_client" : _make_module ("homeassistant.helpers.aiohttp_client" , async_get_clientsession = MagicMock ()),
112128 "homeassistant.helpers.device_registry" : _make_module ("homeassistant.helpers.device_registry" , DeviceEntryType = DeviceEntryType ),
113129 "homeassistant.components" : _make_module ("homeassistant.components" ),
0 commit comments