mirror of
https://github.com/home-assistant/core.git
synced 2026-05-08 09:38:58 +01:00
Prevent callback decorator on coroutine functions (#126429)
* Prevent callback decorator on async functions * Adjust * Adjust * Adjust components * Adjust tests * Rename * One more * Adjust * Adjust again * Apply suggestions from code review Co-authored-by: Martin Hjelmare <marhje52@gmail.com> --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
+2
-2
@@ -2194,7 +2194,7 @@ async def test_async_functions_with_callback(hass: HomeAssistant) -> None:
|
||||
runs = []
|
||||
|
||||
@ha.callback
|
||||
async def test():
|
||||
async def test(): # pylint: disable=hass-async-callback-decorator
|
||||
runs.append(True)
|
||||
|
||||
await hass.async_add_job(test)
|
||||
@@ -2205,7 +2205,7 @@ async def test_async_functions_with_callback(hass: HomeAssistant) -> None:
|
||||
assert len(runs) == 2
|
||||
|
||||
@ha.callback
|
||||
async def service_handler(call):
|
||||
async def service_handler(call): # pylint: disable=hass-async-callback-decorator
|
||||
runs.append(True)
|
||||
|
||||
hass.services.async_register("test_domain", "test_service", service_handler)
|
||||
|
||||
Reference in New Issue
Block a user