use gphoto2::widget::TextWidget;
use gphoto2::{Context, Result};
use std::{thread, time::Duration};
fn main() -> Result<()> {
tracing_subscriber::fmt::init();
let camera = Context::new()?.autodetect_camera().wait()?;
let opcode = camera.config_key::<TextWidget>("opcode").wait()?;
println!("Starting live view");
opcode.set_value("0x9201")?;
camera.set_config(&opcode).wait()?;
thread::sleep(Duration::from_secs(10));
println!("Ending live view");
opcode.set_value("0x9202")?;
camera.set_config(&opcode).wait()?;
Ok(())
}