mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add timeout / debounce (for brightness and others) (#13534)
* Add async timeout feature * Decorator for setter methods to limit service calls to HA * Changed to async * Use async_call_later * Use lastargs, async_add_job * Use dict for lastargs * Updated tests to stop patch
This commit is contained in:
@@ -14,6 +14,7 @@ from homeassistant.const import (
|
||||
CONF_PORT, EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP)
|
||||
|
||||
from tests.common import get_test_home_assistant
|
||||
from tests.components.homekit.test_accessories import patch_debounce
|
||||
|
||||
IP_ADDRESS = '127.0.0.1'
|
||||
PATH_HOMEKIT = 'homeassistant.components.homekit'
|
||||
@@ -22,6 +23,17 @@ PATH_HOMEKIT = 'homeassistant.components.homekit'
|
||||
class TestHomeKit(unittest.TestCase):
|
||||
"""Test setup of HomeKit component and HomeKit class."""
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
"""Setup debounce patcher."""
|
||||
cls.patcher = patch_debounce()
|
||||
cls.patcher.start()
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(cls):
|
||||
"""Stop debounce patcher."""
|
||||
cls.patcher.stop()
|
||||
|
||||
def setUp(self):
|
||||
"""Setup things to be run when tests are started."""
|
||||
self.hass = get_test_home_assistant()
|
||||
|
||||
Reference in New Issue
Block a user