def test_reset_color_control_to_default(device: PyK4A): device.open() device.reset_color_control_to_default() assert device.brightness == 128 # default value 128 device.brightness = 123 assert device.brightness == 123 device.reset_color_control_to_default() assert device.brightness == 128
def test_color_property_setter(device: PyK4A): device.open() device.brightness = 123 assert device.brightness == 123 device.contrast = 4 assert device.contrast == 4 device.saturation = 20 assert device.saturation == 20 device.sharpness = 1 assert device.sharpness == 1 device.backlight_compensation = 1 assert device.backlight_compensation == 1 device.gain = 123 assert device.gain == 123 device.powerline_frequency = 1 assert device.powerline_frequency == 1 device.exposure = 17000 assert device.exposure == 17000 device.exposure_mode_auto = False assert device.exposure_mode_auto is False device.whitebalance = 5000 assert device.whitebalance == 5000 device.whitebalance_mode_auto = False assert device.whitebalance_mode_auto is False
def test_set_color_control(device: PyK4A): device.open() device.brightness = 123
def test_color_property_setter_on_closed_device(device: PyK4A): with pytest.raises(K4AException, match="Device is not opened"): device.brightness = 123