soco 0.1.1
soco: ^0.1.1 copied to clipboard
Control Sonos speakers programmatically. Discover devices, manage playback, groups, alarms, and more. Port of Python SoCo library.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0 - 2025-11-30 #
Initial Release #
First public release of the SoCo Dart port. This is a complete port of the Python SoCo library, providing programmatic control of Sonos speakers from Dart applications.
Added #
Core Features
- SoCo class with 120+ methods for comprehensive speaker control
- Device discovery via SSDP multicast and network scanning
- Playback control: play, pause, stop, next, previous, seek, play from queue
- Volume & audio: volume, mute, bass, treble, loudness, balance
- Queue management: get, add, remove, clear, reorder queue items
- Group management: join, unjoin, party mode, zone groups
- Music library: browse and search local music library
- Alarms: full CRUD operations for Sonos alarms
- Snapshot/restore: save and restore speaker state
- Events: UPnP subscriptions with Dart Streams
- Sleep timer and battery info support
Advanced Features
- Home theater: night mode, dialog mode, audio delay
- Surround speakers: enable/disable, volume control
- Subwoofer: enable/disable, gain, crossover settings
- Stereo pairs: create and separate stereo pairs
- Trueplay and fixed volume support
- Line-in and TV input switching
Music Services
- Music service accounts management
- Token store for service authentication
- Service-specific data structures
- Music service browsing and playback
Plugins
- Plugin system base infrastructure
- ShareLink plugin: Share music links across services
- Plex plugin: Plex media server integration
- Example plugin template
Data Structures
- DIDL-Lite metadata classes (tracks, albums, artists, playlists)
- Search results with pagination
- Zone group and zone member structures
- Alarm and snapshot data models
Project Statistics #
- 18 core modules fully ported
- 5 music service modules
- 4 plugin modules
- 21 test modules with 567+ unit tests
- 80% code coverage (1843/2304 lines)
- 7 comprehensive examples
- Zero analyzer warnings
Differences from Python SoCo #
- All I/O operations are async (
Future-based) - Events use Dart
Streams instead of callbacks - Full null-safety support
- Dart naming conventions (camelCase)
- Immutable data structures where appropriate
0.1.1 - 2025-11-30 #
Fixed #
-
UPnP Service Control URLs: Fixed incorrect control URLs that caused HTTP 405 errors when communicating with real Sonos hardware. Services now use correct paths:
- RenderingControl:
/MediaRenderer/RenderingControl/Control - AVTransport:
/MediaRenderer/AVTransport/Control - ContentDirectory:
/MediaServer/ContentDirectory/Control - And other services with appropriate prefixes
- RenderingControl:
-
getSpeakerInfo Caching: Fixed issue where
getSpeakerInfo()would return incomplete data after device discovery. The method now correctly fetches speaker info even when ZoneGroupState data is already present.
Added #
- Integration Test Suite: Added comprehensive integration test (
test_integration.dart) that validates all core functionality against real Sonos hardware:- Discovery (11 devices found)
- Volume and mute controls
- Transport state and track info
- Speaker info (zone name, model, versions)
- Group operations (coordinator, members, all groups)
- Play mode (shuffle, repeat)
- Audio settings (bass, treble, loudness)
- Sleep timer and available actions
- TV/Line-in/Radio detection
- Music library browsing
- Zone enumeration (all zones, visible zones)
Changed #
- Updated
services.dartwith propereventSubscriptionUrlanddefaultArgsfor all UPnP services to match Python SoCo implementation
Unreleased #
Planned #
- Voice assistant methods (
voiceServiceConfigured,micEnabled,setMicEnabled) - Playlist/favorites methods (~20 methods for Sonos playlist management)
- Enhanced SCPD (Service Control Protocol Description) parsing
- WIMP/Tidal legacy plugin
- Performance optimizations
- Additional dartdoc documentation