15 lines
342 B
Rust
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(())
|
|
}
|