Refactor Hue: phue -> aiohue (#13043)
* phue -> aiohue * Clean up * Fix config * Address comments * Typo * Fix rebase error * Mark light as unavailable when bridge is disconnected * Tests * Make Throttle work with double delay and async * Rework update logic * Don't resolve host to IP * Clarify comment * No longer do unnecessary updates * Add more doc * Another comment update * Wrap up tests * Lint * Fix tests * PyLint does not like mix 'n match async and coroutine * Lint * Update aiohue to 1.2 * Lint * Fix await MagicMock
This commit is contained in:
1 parent
d78e75db66
commit
5a9013cda5
20 files changed
+1289
-1485
No files matched your search
@@ -0,0 +1,17 @@
|
||||
"""Fixtures for Hue tests."""
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
|
||||
from tests.common import mock_coro_func
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_bridge():
|
||||
"""Mock the HueBridge from initializing."""
|
||||
with patch('homeassistant.components.hue._find_username_from_config',
|
||||
return_value=None), \
|
||||
patch('homeassistant.components.hue.HueBridge') as mock_bridge:
|
||||
mock_bridge().async_setup = mock_coro_func()
|
||||
mock_bridge.reset_mock()
|
||||
yield mock_bridge
|
||||
Reference in new issue
Block a user