def test_available(): """Test available property.""" light = hue_light.HueLight( light=Mock(state={'reachable': False}, raw=LIGHT_RAW), request_bridge_update=None, bridge=Mock(allow_unreachable=False), is_group=False, ) assert light.available is False light = hue_light.HueLight( light=Mock(state={'reachable': False}, raw=LIGHT_RAW), request_bridge_update=None, bridge=Mock(allow_unreachable=True), is_group=False, ) assert light.available is True light = hue_light.HueLight( light=Mock(state={'reachable': False}, raw=LIGHT_RAW), request_bridge_update=None, bridge=Mock(allow_unreachable=False), is_group=True, ) assert light.available is True
def test_hs_color(): """Test hs_color property.""" light = hue_light.HueLight( light=Mock( state={ "colormode": "ct", "hue": 1234, "sat": 123 }, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT, ), coordinator=Mock(last_update_success=True), bridge=Mock(), is_group=False, supported_features=hue_light.SUPPORT_HUE_EXTENDED, ) assert light.hs_color is None light = hue_light.HueLight( light=Mock( state={ "colormode": "hs", "hue": 1234, "sat": 123 }, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT, ), coordinator=Mock(last_update_success=True), bridge=Mock(), is_group=False, supported_features=hue_light.SUPPORT_HUE_EXTENDED, ) assert light.hs_color is None light = hue_light.HueLight( light=Mock( state={ "colormode": "xy", "hue": 1234, "sat": 123, "xy": [0.4, 0.5] }, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT, ), coordinator=Mock(last_update_success=True), bridge=Mock(), is_group=False, supported_features=hue_light.SUPPORT_HUE_EXTENDED, ) assert light.hs_color == color.color_xy_to_hs(0.4, 0.5, LIGHT_GAMUT)
def test_hs_color(): """Test hs_color property.""" light = hue_light.HueLight( light=Mock( state={ "colormode": "ct", "hue": 1234, "sat": 123 }, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT, ), request_bridge_update=None, bridge=Mock(), is_group=False, ) assert light.hs_color is None light = hue_light.HueLight( light=Mock( state={ "colormode": "hs", "hue": 1234, "sat": 123 }, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT, ), request_bridge_update=None, bridge=Mock(), is_group=False, ) assert light.hs_color is None light = hue_light.HueLight( light=Mock( state={ "colormode": "xy", "hue": 1234, "sat": 123, "xy": [0.4, 0.5] }, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT, ), request_bridge_update=None, bridge=Mock(), is_group=False, ) assert light.hs_color == color.color_xy_to_hs(0.4, 0.5, LIGHT_GAMUT)
def test_hs_color(): """Test hs_color property.""" light = hue_light.HueLight( light=Mock(state={ 'colormode': 'ct', 'hue': 1234, 'sat': 123, }, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT), request_bridge_update=None, bridge=Mock(), is_group=False, ) assert light.hs_color is None light = hue_light.HueLight( light=Mock(state={ 'colormode': 'hs', 'hue': 1234, 'sat': 123, }, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT), request_bridge_update=None, bridge=Mock(), is_group=False, ) assert light.hs_color is None light = hue_light.HueLight( light=Mock(state={ 'colormode': 'xy', 'hue': 1234, 'sat': 123, 'xy': [0.4, 0.5] }, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT), request_bridge_update=None, bridge=Mock(), is_group=False, ) assert light.hs_color == color.color_xy_to_hs(0.4, 0.5, LIGHT_GAMUT)
def test_available(): """Test available property.""" light = hue_light.HueLight( light=Mock( state={"reachable": False}, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT, ), coordinator=Mock(last_update_success=True), bridge=Mock(allow_unreachable=False), is_group=False, supported_features=hue_light.SUPPORT_HUE_EXTENDED, rooms={}, ) assert light.available is False light = hue_light.HueLight( light=Mock( state={"reachable": False}, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT, ), coordinator=Mock(last_update_success=True), bridge=Mock(allow_unreachable=True), is_group=False, supported_features=hue_light.SUPPORT_HUE_EXTENDED, rooms={}, ) assert light.available is True light = hue_light.HueLight( light=Mock( state={"reachable": False}, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT, ), coordinator=Mock(last_update_success=True), bridge=Mock(allow_unreachable=False), is_group=True, supported_features=hue_light.SUPPORT_HUE_EXTENDED, rooms={}, ) assert light.available is True
def test_available(): """Test available property.""" light = hue_light.HueLight( light=Mock( state={"reachable": False}, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT, ), request_bridge_update=None, bridge=Mock(allow_unreachable=False), is_group=False, ) assert light.available is False light = hue_light.HueLight( light=Mock( state={"reachable": False}, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT, ), request_bridge_update=None, bridge=Mock(allow_unreachable=True), is_group=False, ) assert light.available is True light = hue_light.HueLight( light=Mock( state={"reachable": False}, raw=LIGHT_RAW, colorgamuttype=LIGHT_GAMUT_TYPE, colorgamut=LIGHT_GAMUT, ), request_bridge_update=None, bridge=Mock(allow_unreachable=False), is_group=True, ) assert light.available is True