Fix Hue error logging (#13616)
This commit is contained in:
parent
cd96d7b2ec
commit
eb763764b3
2 changed files with 13 additions and 2 deletions
|
@ -31,9 +31,14 @@ class HueBridge(object):
|
|||
self.available = True
|
||||
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):
|
||||
"""Set up a phue bridge based on host parameter."""
|
||||
host = self.config_entry.data['host']
|
||||
host = self.host
|
||||
|
||||
try:
|
||||
self.api = await get_bridge(
|
||||
|
|
|
@ -160,7 +160,13 @@ LIGHT_RESPONSE = {
|
|||
@pytest.fixture
|
||||
def mock_bridge(hass):
|
||||
"""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 = []
|
||||
# We're using a deque so we can schedule multiple responses
|
||||
# and also means that `popleft()` will blow up if we get more updates
|
||||
|
|
Loading…
Add table
Reference in a new issue