Remove usage of async_add_job in tests (#113259)

This commit is contained in:
J. Nick Koston
2024-03-13 19:33:33 -10:00
committed by GitHub
parent c3b5e819c5
commit c1f5c7c4b7
11 changed files with 22 additions and 22 deletions

View File

@@ -27,7 +27,7 @@ def async_start(hass, entity_id=None):
This is a legacy helper method. Do not use it for new tests.
"""
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
hass.async_add_job(hass.services.async_call(DOMAIN, SERVICE_START, data))
hass.create_task(hass.services.async_call(DOMAIN, SERVICE_START, data))
@callback
@@ -37,7 +37,7 @@ def async_stop(hass, entity_id=None):
This is a legacy helper method. Do not use it for new tests.
"""
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
hass.async_add_job(hass.services.async_call(DOMAIN, SERVICE_STOP, data))
hass.create_task(hass.services.async_call(DOMAIN, SERVICE_STOP, data))
@callback
@@ -47,7 +47,7 @@ def async_restart(hass, entity_id=None):
This is a legacy helper method. Do not use it for new tests.
"""
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
hass.async_add_job(hass.services.async_call(DOMAIN, SERVICE_RESTART, data))
hass.create_task(hass.services.async_call(DOMAIN, SERVICE_RESTART, data))
class MockFFmpegDev(ffmpeg.FFmpegBase):