8000 Hue light: No traceback for timeouts or refused connections to the bridge by azogue · Pull Request #8524 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Hue light: No traceback for timeouts or refused connections to the bridge #8524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions homeassistant/components/light/hue.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):

if discovery_info is not None:
if "HASS Bridge" in discovery_info.get('name', ''):
_LOGGER.info('Emulated hue found, will not add')
_LOGGER.info("Emulated hue found, will not add")
return False

host = discovery_info.get('host')
Expand All @@ -126,7 +126,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
host = _find_host_from_config(hass, filename)

if host is None:
_LOGGER.error('No host found in configuration')
_LOGGER.error("No host found in configuration")
return False

# Only act if we are not already configuring this host
Expand Down Expand Up @@ -180,6 +180,12 @@ def update_lights():

try:
api = bridge.get_api()
except phue.PhueRequestTimeout:
_LOGGER.warning("Timeout trying to reach the bridge")
return
except ConnectionRefusedError:
_LOGGER.error("The bridge refused the connection")
return
except socket.error:
# socket.error when we cannot reach Hue
_LOGGER.exception("Cannot reach the bridge")
Expand Down Expand Up @@ -221,8 +227,8 @@ def update_lights():

for lightgroup_id, info in api_groups.items():
if 'state' not in info:
_LOGGER.warning('Group info does not contain state. '
'Please update your hub.')
_LOGGER.warning("Group info does not contain state. "
"Please update your hub.")
skip_groups = True
break

Expand Down
0