Add async_safe annotation (#3688)
* Add async_safe annotation * More async_run_job * coroutine -> async_save * Lint * Rename async_safe -> callback * Add tests to core for different job types * Add one more test with different type of callbacks * Fix typing signature for callback methods * Fix callback service executed method * Fix method signatures for callback
This commit is contained in:
1 parent
be7401f4a2
commit
5085cdb0f7
19 files changed
+231
-87
No files matched your search
@@ -139,7 +139,8 @@ class TestAPI(unittest.TestCase):
|
||||
hass.states.set("test.test", "not_to_be_set")
|
||||
|
||||
events = []
|
||||
hass.bus.listen(const.EVENT_STATE_CHANGED, events.append)
|
||||
hass.bus.listen(const.EVENT_STATE_CHANGED,
|
||||
lambda ev: events.append(ev))
|
||||
|
||||
requests.post(_url(const.URL_API_STATES_ENTITY.format("test.test")),
|
||||
data=json.dumps({"state": "not_to_be_set"}),
|
||||
|
||||
Reference in new issue
Block a user