-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1302 from JoeyEamigh/add-group-flag
add flag to display connect device as group
- Loading branch information
Showing
5 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters