From eb763764b39c8913c913c85ef81b783cef73577f Mon Sep 17 00:00:00 2001
From: Paulus Schoutsen <paulus@paulusschoutsen.nl>
Date: Sun, 1 Apr 2018 09:03:01 -0700
Subject: [PATCH] Fix Hue error logging (#13616)

---
 homeassistant/components/hue/bridge.py | 7 ++++++-
 tests/components/light/test_hue.py     | 8 +++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/homeassistant/components/hue/bridge.py b/homeassistant/components/hue/bridge.py
index 790831a4d6c..8093c84971e 100644
--- a/homeassistant/components/hue/bridge.py
+++ b/homeassistant/components/hue/bridge.py
@@ -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(
diff --git a/tests/components/light/test_hue.py b/tests/components/light/test_hue.py
index d73531b1b9a..7b6c3a21a79 100644
--- a/tests/components/light/test_hue.py
+++ b/tests/components/light/test_hue.py
@@ -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
-- 
GitLab