Fix calling sync api in counter/ffmpeg/device_tracker tests (#113441)
This commit is contained in:
parent
2b3f0a9459
commit
aaac879c83
3 changed files with 7 additions and 7 deletions
|
@ -19,7 +19,7 @@ from homeassistant.loader import bind_hass
|
||||||
@bind_hass
|
@bind_hass
|
||||||
def async_increment(hass, entity_id):
|
def async_increment(hass, entity_id):
|
||||||
"""Increment a counter."""
|
"""Increment a counter."""
|
||||||
hass.create_task(
|
hass.async_create_task(
|
||||||
hass.services.async_call(DOMAIN, SERVICE_INCREMENT, {ATTR_ENTITY_ID: entity_id})
|
hass.services.async_call(DOMAIN, SERVICE_INCREMENT, {ATTR_ENTITY_ID: entity_id})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ def async_increment(hass, entity_id):
|
||||||
@bind_hass
|
@bind_hass
|
||||||
def async_decrement(hass, entity_id):
|
def async_decrement(hass, entity_id):
|
||||||
"""Decrement a counter."""
|
"""Decrement a counter."""
|
||||||
hass.create_task(
|
hass.async_create_task(
|
||||||
hass.services.async_call(DOMAIN, SERVICE_DECREMENT, {ATTR_ENTITY_ID: entity_id})
|
hass.services.async_call(DOMAIN, SERVICE_DECREMENT, {ATTR_ENTITY_ID: entity_id})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -37,6 +37,6 @@ def async_decrement(hass, entity_id):
|
||||||
@bind_hass
|
@bind_hass
|
||||||
def async_reset(hass, entity_id):
|
def async_reset(hass, entity_id):
|
||||||
"""Reset a counter."""
|
"""Reset a counter."""
|
||||||
hass.create_task(
|
hass.async_create_task(
|
||||||
hass.services.async_call(DOMAIN, SERVICE_RESET, {ATTR_ENTITY_ID: entity_id})
|
hass.services.async_call(DOMAIN, SERVICE_RESET, {ATTR_ENTITY_ID: entity_id})
|
||||||
)
|
)
|
||||||
|
|
|
@ -50,4 +50,4 @@ def async_see(
|
||||||
}
|
}
|
||||||
if attributes:
|
if attributes:
|
||||||
data[ATTR_ATTRIBUTES] = 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.
|
This is a legacy helper method. Do not use it for new tests.
|
||||||
"""
|
"""
|
||||||
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
|
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
|
@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.
|
This is a legacy helper method. Do not use it for new tests.
|
||||||
"""
|
"""
|
||||||
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
|
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
|
@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.
|
This is a legacy helper method. Do not use it for new tests.
|
||||||
"""
|
"""
|
||||||
data = {ATTR_ENTITY_ID: entity_id} if entity_id else {}
|
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):
|
class MockFFmpegDev(ffmpeg.FFmpegBase):
|
||||||
|
|
Loading…
Add table
Reference in a new issue