diff --git a/tests/components/counter/common.py b/tests/components/counter/common.py index 72d183a7b0f..b5156c1a432 100644 --- a/tests/components/counter/common.py +++ b/tests/components/counter/common.py @@ -19,7 +19,7 @@ from homeassistant.loader import bind_hass @bind_hass def async_increment(hass, entity_id): """Increment a counter.""" - hass.create_task( + hass.async_create_task( hass.services.async_call(DOMAIN, SERVICE_INCREMENT, {ATTR_ENTITY_ID: entity_id}) ) @@ -28,7 +28,7 @@ def async_increment(hass, entity_id): @bind_hass def async_decrement(hass, entity_id): """Decrement a counter.""" - hass.create_task( + hass.async_create_task( hass.services.async_call(DOMAIN, SERVICE_DECREMENT, {ATTR_ENTITY_ID: entity_id}) ) @@ -37,6 +37,6 @@ def async_decrement(hass, entity_id): @bind_hass def async_reset(hass, entity_id): """Reset a counter.""" - hass.create_task( + hass.async_create_task( hass.services.async_call(DOMAIN, SERVICE_RESET, {ATTR_ENTITY_ID: entity_id}) ) diff --git a/tests/components/device_tracker/common.py b/tests/components/device_tracker/common.py index 6e2c7b253c3..973eb7d8820 100644 --- a/tests/components/device_tracker/common.py +++ b/tests/components/device_tracker/common.py @@ -50,4 +50,4 @@ def async_see( } if attributes: data[ATTR_ATTRIBUTES] = attributes - hass.create_task(hass.services.async_call(DOMAIN, SERVICE_SEE, data)) + hass.async_create_task(hass.services.async_call(DOMAIN, SERVICE_SEE, data)) diff --git a/tests/components/ffmpeg/test_init.py b/tests/components/ffmpeg/test_init.py index e945a26e05b..23d00d7e46b 100644 --- a/tests/components/ffmpeg/test_init.py +++ b/tests/components/ffmpeg/test_init.py @@ -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.create_task(hass.services.async_call(DOMAIN, SERVICE_START, data)) + hass.async_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.create_task(hass.services.async_call(DOMAIN, SERVICE_STOP, data)) + hass.async_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.create_task(hass.services.async_call(DOMAIN, SERVICE_RESTART, data)) + hass.async_create_task(hass.services.async_call(DOMAIN, SERVICE_RESTART, data)) class MockFFmpegDev(ffmpeg.FFmpegBase):