mirror of
https://github.com/home-assistant/core.git
synced 2025-08-01 19:55:10 +02:00
Fix calling sync api in counter/ffmpeg/device_tracker tests (#113441)
This commit is contained in:
@@ -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})
|
||||
)
|
||||
|
@@ -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))
|
||||
|
@@ -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):
|
||||
|
Reference in New Issue
Block a user