Expand description
§WiiM API Client
A Rust library for controlling WiiM audio streaming devices via their HTTP API.
§Features
- Now Playing Info: Get current track metadata including title, artist, album, and cover art
- Playback Control: Play, pause, stop, next/previous track
- Volume Control: Set volume, relative volume changes, mute/unmute
- Device Information: Get network quality, WiFi signal strength, and device details
- Connection Management: Test connectivity and configure target IP
§Quick Start
use wiim_api::{WiimClient, Result};
#[tokio::main]
async fn main() -> Result<()> {
// Connect to your WiiM device
let client = WiimClient::connect("192.168.1.100").await?;
// Get now playing information
let now_playing = client.get_now_playing().await?;
println!("♪ {} - {}",
now_playing.artist.unwrap_or_default(),
now_playing.title.unwrap_or_default()
);
// Get device and network information
let status_ex = client.get_status_ex().await?;
if let Some(signal) = status_ex.signal_quality() {
println!("📶 WiFi Signal: {} ({})",
signal,
status_ex.rssi_formatted().unwrap_or_default()
);
}
// Control playback
client.set_volume(75).await?;
client.pause().await?;
Ok(())
}
§Finding Your Device IP
- Check your router’s admin page (usually 192.168.1.1)
- Use network scanner apps
- Check the WiiM mobile app settings
- Use command:
nmap -sn 192.168.1.0/24
Structs§
- Meta
Data - Track metadata from the WiiM device
- Meta
Info - Container for track metadata response
- NowPlaying
- Complete now playing information combining playback status and track metadata
- Player
Status - Raw player status response from the WiiM device
- Status
Ex - Extended device status response from getStatusEx API
- Wiim
Client - HTTP client for communicating with WiiM devices
Enums§
Type Aliases§
- Result
- Result type for WiiM API operations