1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-03 01:39:28 +02:00

adding flag to show connect device as group

This commit is contained in:
Joey Eamigh 2024-06-15 23:36:47 -04:00
parent c10d29b829
commit 180ffacde1
No known key found for this signature in database
GPG key ID: CE8C05DFFC53C9CB
5 changed files with 49 additions and 1 deletions

View file

@ -0,0 +1,22 @@
use futures::StreamExt;
use librespot_core::SessionConfig;
use librespot_discovery::DeviceType;
use sha1::{Digest, Sha1};
#[tokio::main(flavor = "current_thread")]
async fn main() {
let name = "Librespot Group";
let device_id = hex::encode(Sha1::digest(name.as_bytes()));
let mut server =
librespot_discovery::Discovery::builder(device_id, SessionConfig::default().client_id)
.name(name)
.device_type(DeviceType::Speaker)
.is_group(true)
.launch()
.unwrap();
while let Some(x) = server.next().await {
println!("Received {:?}", x);
}
}