Async tests for counter (#18684)

This commit is contained in:
Adam Mills 2018-11-24 16:12:29 -05:00 committed by GitHub
parent 66f1643de5
commit 6f0a3b4b22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 110 additions and 138 deletions

View file

@ -10,12 +10,6 @@ from homeassistant.core import callback
from homeassistant.loader import bind_hass
@bind_hass
def increment(hass, entity_id):
"""Increment a counter."""
hass.add_job(async_increment, hass, entity_id)
@callback
@bind_hass
def async_increment(hass, entity_id):
@ -24,12 +18,6 @@ def async_increment(hass, entity_id):
DOMAIN, SERVICE_INCREMENT, {ATTR_ENTITY_ID: entity_id}))
@bind_hass
def decrement(hass, entity_id):
"""Decrement a counter."""
hass.add_job(async_decrement, hass, entity_id)
@callback
@bind_hass
def async_decrement(hass, entity_id):
@ -38,12 +26,6 @@ def async_decrement(hass, entity_id):
DOMAIN, SERVICE_DECREMENT, {ATTR_ENTITY_ID: entity_id}))
@bind_hass
def reset(hass, entity_id):
"""Reset a counter."""
hass.add_job(async_reset, hass, entity_id)
@callback
@bind_hass
def async_reset(hass, entity_id):