hue-control/src/commands/list.rs
2022-04-09 22:51:17 +02:00

15 lines
342 B
Rust

use eyre::Result;
use crate::api;
use crate::config::Config;
pub async fn exec(config: Config) -> Result<()> {
let lights = api::lights::all(config).await?;
for light in lights {
let icon = if light.on.on { "💡" } else { "🔌" };
println!("{} - {} - {}", icon, light.id, light.metadata.name)
}
Ok(())
}