mirror of
https://github.com/home-assistant/core.git
synced 2025-04-28 11:17:53 +00:00
Fix Hue error logging (#13616)
This commit is contained in:
parent
cd96d7b2ec
commit
eb763764b3
@ -31,9 +31,14 @@ class HueBridge(object):
|
|||||||
self.available = True
|
self.available = True
|
||||||
self.api = None
|
self.api = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def host(self):
|
||||||
|
"""Return the host of this bridge."""
|
||||||
|
return self.config_entry.data['host']
|
||||||
|
|
||||||
async def async_setup(self, tries=0):
|
async def async_setup(self, tries=0):
|
||||||
"""Set up a phue bridge based on host parameter."""
|
"""Set up a phue bridge based on host parameter."""
|
||||||
host = self.config_entry.data['host']
|
host = self.host
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.api = await get_bridge(
|
self.api = await get_bridge(
|
||||||
|
@ -160,7 +160,13 @@ LIGHT_RESPONSE = {
|
|||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def mock_bridge(hass):
|
def mock_bridge(hass):
|
||||||
"""Mock a Hue bridge."""
|
"""Mock a Hue bridge."""
|
||||||
bridge = Mock(available=True, allow_groups=False, host='1.1.1.1')
|
bridge = Mock(
|
||||||
|
available=True,
|
||||||
|
allow_unreachable=False,
|
||||||
|
allow_groups=False,
|
||||||
|
api=Mock(),
|
||||||
|
spec=hue.HueBridge
|
||||||
|
)
|
||||||
bridge.mock_requests = []
|
bridge.mock_requests = []
|
||||||
# We're using a deque so we can schedule multiple responses
|
# We're using a deque so we can schedule multiple responses
|
||||||
# and also means that `popleft()` will blow up if we get more updates
|
# and also means that `popleft()` will blow up if we get more updates
|
||||||
|
Loading…
x
Reference in New Issue
Block a user