use ble_ledly::capability::color::*;
use ble_ledly::communication_protocol::GenericRGB;
use ble_ledly::device::LedDevice;
use ble_ledly::device::{CharKind, UuidKind};
use ble_ledly::Controller;
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let mut controller = Controller::<LedDevice>::new_with_prefix("QHM-").await?;
controller.connect().await?;
let protocol = GenericRGB::default();
controller.set_all_char(&CharKind::Write, &UuidKind::Uuid16(0xFFD9))?;
let first_light = controller.list().get(0).unwrap();
first_light.color(&protocol, 255, 0, 0).await?;
Ok(())
}