mirror of
https://github.com/gesellix/Bose-SoundTouch.git
synced 2026-08-24 14:47:23 +00:00
feat: Implement official /addZoneSlave and /removeZoneSlave endpoints
Implements the remaining zone slave management endpoints from the official Bose SoundTouch Web API v1.0 specification, bringing API coverage to 89%. ## New Features ### Client Methods - AddZoneSlave(masterID, slaveID, slaveIP) - Add individual device to zone - AddZoneSlaveByDeviceID(masterID, slaveID) - Add device by ID only - RemoveZoneSlave(masterID, slaveID, slaveIP) - Remove individual device - RemoveZoneSlaveByDeviceID(masterID, slaveID) - Remove device by ID only ### Models - ZoneSlaveRequest - Request structure for slave operations - ZoneSlaveEntry - Individual slave entry with IP address support - Complete XML marshaling/unmarshaling with proper omitempty handling - Comprehensive validation and error handling ### CLI Commands - zone add-slave --master ID --slave ID [--slave-ip IP] - zone remove-slave --master ID --slave ID [--slave-ip IP] ## Implementation Details - Follows official API specification exactly (POST /addZoneSlave, /removeZoneSlave) - Supports both device ID + IP and device ID only operations - Comprehensive input validation (IP addresses, device ID conflicts) - Proper XML formatting with omitempty for optional IP addresses - Extensive test coverage (580+ lines of tests) - Integration with existing high-level zone management API ## Testing - 200+ new test cases covering all functionality - Complete model validation and XML marshaling tests - HTTP client integration tests with mock servers - Error handling and edge case coverage - Network error simulation tests ## Documentation Updates - Updated API coverage from 84% to 89% (17/19 endpoints) - Comprehensive API coverage analysis document - Updated README.md with new endpoint status - Added practical usage examples - CLI help documentation ## Compatibility - Maintains full backward compatibility - Complements existing high-level zone API - Users can choose between low-level official API or enhanced high-level API - No breaking changes to existing functionality This implementation provides both the exact official API endpoints and enhanced high-level zone management, giving users maximum flexibility for zone operations while maintaining full API compliance.
This commit is contained in:
@@ -288,13 +288,22 @@ Gets track information (duplicate of `/now_playing` per official API).
|
||||
|
||||
**Implementation**: Available via `GetTrackInfo()` method with identical response format to `/now_playing`.
|
||||
|
||||
### Zone Slave Management ⚠️ **Different Implementation**
|
||||
Our implementation uses high-level methods instead of official endpoints:
|
||||
- **Official**: `/addZoneSlave` (POST) - Add slave to zone
|
||||
- **Official**: `/removeZoneSlave` (POST) - Remove slave from zone
|
||||
- **Our Implementation**: `AddToZone()` and `RemoveFromZone()` methods via `/setZone`
|
||||
### Zone Slave Management ✅ **Implemented**
|
||||
Both official low-level endpoints and high-level zone management are available:
|
||||
|
||||
**Status**: Functionally equivalent and arguably cleaner approach.
|
||||
#### POST /addZoneSlave ✅ **Implemented**
|
||||
Add individual device to existing zone using official API format.
|
||||
|
||||
**Implementation**: Available via `AddZoneSlave()` and `AddZoneSlaveByDeviceID()` methods
|
||||
|
||||
#### POST /removeZoneSlave ✅ **Implemented**
|
||||
Remove individual device from existing zone using official API format.
|
||||
|
||||
**Implementation**: Available via `RemoveZoneSlave()` and `RemoveZoneSlaveByDeviceID()` methods
|
||||
|
||||
#### High-Level Zone API ✅ **Enhanced**
|
||||
- **Enhanced**: `CreateZone()`, `AddToZone()`, `RemoveFromZone()` methods via `/setZone`
|
||||
- **Status**: Provides both official low-level API and enhanced high-level operations
|
||||
|
||||
### Advanced Audio Controls ❌ **Missing**
|
||||
Professional/high-end device features (only available via `/capabilities` check):
|
||||
@@ -321,10 +330,10 @@ These endpoints work with real hardware but are NOT in official API v1.0:
|
||||
|
||||
## Coverage Summary
|
||||
|
||||
### Official API Coverage: 84%
|
||||
### Official API Coverage: 89%
|
||||
- **Total Official Endpoints**: 19
|
||||
- **Implemented**: 16 (84%)
|
||||
- **Missing Low-Impact**: 3 (16%)
|
||||
- **Implemented**: 17 (89%)
|
||||
- **Missing Low-Impact**: 2 (11%)
|
||||
|
||||
### Feature Coverage: 100%
|
||||
- ✅ All essential user functionality implemented
|
||||
|
||||
Reference in New Issue
Block a user