diff --git a/homeassistant/components/emulated_hue.py b/homeassistant/components/emulated_hue.py index 1b2581075bc..9f145efecc5 100755 --- a/homeassistant/components/emulated_hue.py +++ b/homeassistant/components/emulated_hue.py @@ -17,7 +17,7 @@ from homeassistant import util, core from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME, SERVICE_TURN_OFF, SERVICE_TURN_ON, EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP, - STATE_ON + STATE_ON, HTTP_BAD_REQUEST ) from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_SUPPORTED_FEATURES, SUPPORT_BRIGHTNESS @@ -202,11 +202,10 @@ class HueUsernameView(HomeAssistantView): data = request.json if 'devicetype' not in data: - return self.Response("devicetype not specified", status=400) + return self.json_message('devicetype not specified', + HTTP_BAD_REQUEST) - json_response = [{'success': {'username': '12345678901234567890'}}] - - return self.json(json_response) + return self.json([{'success': {'username': '12345678901234567890'}}]) class HueLightsView(HomeAssistantView): diff --git a/homeassistant/components/light/hue.py b/homeassistant/components/light/hue.py index 3ac7f3ae5f6..8f83f8150db 100644 --- a/homeassistant/components/light/hue.py +++ b/homeassistant/components/light/hue.py @@ -94,7 +94,7 @@ def setup_bridge(host, hass, add_devices_callback, filename, host, config_file_path=hass.config.path(filename)) except ConnectionRefusedError: # Wrong host was given - _LOGGER.exception("Error connecting to the Hue bridge at %s", host) + _LOGGER.error("Error connecting to the Hue bridge at %s", host) return