Implement Hue available property (#12939)
This commit is contained in:
1 parent
e6683b4c84
commit
a7f34bbce9
2 files changed
+49
-4
No files matched your search
@@ -501,3 +501,45 @@ class TestHueLight(unittest.TestCase):
|
||||
|
||||
light = self.buildLight(info={}, is_group=True)
|
||||
self.assertIsNone(light.unique_id)
|
||||
|
||||
|
||||
def test_available():
|
||||
"""Test available property."""
|
||||
light = hue_light.HueLight(
|
||||
info={'state': {'reachable': False}},
|
||||
allow_unreachable=False,
|
||||
is_group=False,
|
||||
|
||||
light_id=None,
|
||||
bridge=mock.Mock(),
|
||||
update_lights_cb=None,
|
||||
allow_in_emulated_hue=False,
|
||||
)
|
||||
|
||||
assert light.available is False
|
||||
|
||||
light = hue_light.HueLight(
|
||||
info={'state': {'reachable': False}},
|
||||
allow_unreachable=True,
|
||||
is_group=False,
|
||||
|
||||
light_id=None,
|
||||
bridge=mock.Mock(),
|
||||
update_lights_cb=None,
|
||||
allow_in_emulated_hue=False,
|
||||
)
|
||||
|
||||
assert light.available is True
|
||||
|
||||
light = hue_light.HueLight(
|
||||
info={'state': {'reachable': False}},
|
||||
allow_unreachable=False,
|
||||
is_group=True,
|
||||
|
||||
light_id=None,
|
||||
bridge=mock.Mock(),
|
||||
update_lights_cb=None,
|
||||
allow_in_emulated_hue=False,
|
||||
)
|
||||
|
||||
assert light.available is True
|
||||
Reference in new issue
Block a user