pass allow_unreachable all the way down the line
This commit is contained in:
parent
5abff70a87
commit
dd33831cb1
1 changed files with 6 additions and 4 deletions
|
@ -71,10 +71,10 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
if host in _CONFIGURING:
|
if host in _CONFIGURING:
|
||||||
return
|
return
|
||||||
|
|
||||||
setup_bridge(host, hass, add_devices_callback, filename)
|
setup_bridge(host, hass, add_devices_callback, filename, allow_unreachable)
|
||||||
|
|
||||||
|
|
||||||
def setup_bridge(host, hass, add_devices_callback, filename):
|
def setup_bridge(host, hass, add_devices_callback, filename, allow_unreachable):
|
||||||
"""Setup a phue bridge based on host parameter."""
|
"""Setup a phue bridge based on host parameter."""
|
||||||
import phue
|
import phue
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ def setup_bridge(host, hass, add_devices_callback, filename):
|
||||||
if light_id not in lights:
|
if light_id not in lights:
|
||||||
lights[light_id] = HueLight(int(light_id), info,
|
lights[light_id] = HueLight(int(light_id), info,
|
||||||
bridge, update_lights,
|
bridge, update_lights,
|
||||||
bridge_type=bridge_type)
|
bridge_type, allow_unreachable)
|
||||||
new_lights.append(lights[light_id])
|
new_lights.append(lights[light_id])
|
||||||
else:
|
else:
|
||||||
lights[light_id].info = info
|
lights[light_id].info = info
|
||||||
|
@ -173,7 +173,7 @@ class HueLight(Light):
|
||||||
|
|
||||||
# pylint: disable=too-many-arguments
|
# pylint: disable=too-many-arguments
|
||||||
def __init__(self, light_id, info, bridge, update_lights,
|
def __init__(self, light_id, info, bridge, update_lights,
|
||||||
bridge_type='hue'):
|
bridge_type='hue', allow_unreachable=False):
|
||||||
"""Initialize the light."""
|
"""Initialize the light."""
|
||||||
self.light_id = light_id
|
self.light_id = light_id
|
||||||
self.info = info
|
self.info = info
|
||||||
|
@ -181,6 +181,8 @@ class HueLight(Light):
|
||||||
self.update_lights = update_lights
|
self.update_lights = update_lights
|
||||||
self.bridge_type = bridge_type
|
self.bridge_type = bridge_type
|
||||||
|
|
||||||
|
self.allow_unreachable = allow_unreachable
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self):
|
||||||
"""Return the ID of this Hue light."""
|
"""Return the ID of this Hue light."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue