Crates.io | sonos |
lib.rs | sonos |
version | 0.1.4 |
source | src |
created_at | 2017-12-10 00:12:34.434542 |
updated_at | 2020-02-20 20:37:13.89725 |
description | Sonos controller library for.. controlling Sonos |
homepage | |
repository | https://github.com/w4/sonos.rs |
max_upload_size | |
id | 42293 |
size | 33,572 |
sonos.rs is a Sonos controller library written in Rust. Currently it only supports playback operations (play, pause, stop, skip, add track to queue, remove track from queue) with no support for search operations as of yet.
Example:
extern crate sonos;
let devices = sonos::discover().unwrap();
let bedroom = devices.iter()
.find(|d| d.name == "Bedroom")
.expect("Couldn't find bedroom");
let track = bedroom.track().unwrap();
let volume = bedroom.volume().unwrap();
bedroom.play();
println!("Now playing {} - {} at {}% volume.", track.title, track.artist, volume);