Skip to content

Commit

Permalink
Better Hue error reporting (home-assistant#3443)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Sep 19, 2016
1 parent 9a87e5e commit 8a99ce7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions homeassistant/components/emulated_hue.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
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
Expand Down Expand Up @@ -202,11 +202,10 @@ def post(self, request):
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):
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/light/hue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8a99ce7

Please sign in to comment.