Commit Graph
3 Commits
Author SHA1 Message Date
Tobias Gesellchen de2ff3550f Implement /name, /capabilities, and /presets informational endpoints
## New Endpoints

### GET /name 
- Simple device name retrieval with XML parsing
- Helper methods for name validation and display
- Real device name integration with anonymization

### GET /capabilities 
- Comprehensive device capabilities detection
- Complex XML structure with nested network, DSP, and system configurations
- Smart categorization: System Features, Audio Features, Network Features
- Capability-specific helper methods (HasLRStereoCapability, HasDualModeNetwork, etc.)
- Extended capabilities parsing with URLs and metadata

### GET /presets 
- Complete preset management with timestamps and metadata
- Spotify playlist integration with anonymized account information
- Smart filtering: by source, used/empty slots, most recent, oldest presets
- Comprehensive analysis: preset summaries with source breakdowns
- Time-based operations: creation/update timestamps with formatted display

## Device Introspection Features

### Capability Detection
- System capabilities: Light Switch, Clock Display, BCO Reset, Power Saving
- Audio capabilities: L/R Stereo support, DSP Mono/Stereo availability
- Network capabilities: Dual Mode, WSAPI Proxy, Hosted WiFi Configuration
- Extended capabilities: Custom endpoint discovery with URL mapping

### Preset Analysis
- Usage pattern analysis (used vs empty slots)
- Source distribution (Spotify, TuneIn, etc.)
- Temporal analysis (most recent, oldest presets)
- Content metadata extraction (artwork URLs, display names)

## Enhanced CLI Tool

### New Commands
- Added -name command with simple device identification
- Added -capabilities command with categorized feature display
- Added -presets command with comprehensive preset analysis
- Enhanced help system with all new command examples

### Rich Output Formatting
- Capability categorization with bullet-point display
- Preset timeline with creation/update timestamps
- Smart metadata display (artwork, source accounts, content types)
- Device-specific feature highlighting (different capabilities per device)

## Real Device Integration

### Multi-Device Testing
- Device 192.168.178.28: SoundTouch 10 with Light Switch, Clock Display, Hosted WiFi
- Device 192.168.178.35: SoundTouch 20 with L/R Stereo, Dual Mode networking
- Verified capability differences between device models
- Real preset data with anonymized Spotify account information

### Edge Case Handling
- Non-responsive endpoints (/trackInfo timeout handling)
- Empty preset configurations
- Missing capability sections
- Device-specific feature variations

## Quality & Testing

### Comprehensive Test Coverage
- 15+ unit tests for XML models with real device response patterns
- Client integration tests with mock HTTP servers
- Edge case validation (empty names, missing capabilities, no presets)
- Timestamp parsing and validation with Unix epoch conversion

### Production-Ready Features
- Type-safe XML unmarshaling with custom validation
- Robust error handling for network and parsing failures
- Privacy protection with anonymized real device data
- Documentation updates with real-world usage examples

## API Coverage Progress

 Complete Information Endpoints:
- GET /info - Device information
- GET /name - Device name
- GET /capabilities - Device capabilities
- GET /presets - Configured presets
- GET /now_playing - Current playback status
- GET /sources - Available audio sources

🔄 Next Phase - Control Endpoints:
- POST /key - Media controls
- GET/POST /volume - Volume management
- WebSocket / - Real-time events

Features:
 Comprehensive device introspection and capability detection
 Smart preset management with timeline analysis
 Multi-device support with hardware-specific feature detection
 Production-ready error handling and data validation
 Rich CLI interface with categorized output formatting
 Real device integration with privacy-protected test data
2026-01-08 23:32:18 +01:00
Tobias Gesellchen 5caad90d51 Implement /now_playing and /sources endpoints with real device integration
## New Endpoints

### GET /now_playing 
- Rich XML models with PlayStatus, ShuffleSetting, RepeatSetting enums
- Comprehensive playback information (track, artist, album, artwork, position)
- Device capabilities (skip, seek, favorite functionality)
- Smart display methods for different content types (music vs radio)
- Duration formatting with position/total time display

### GET /sources 
- Complete audio source management with SourceStatus enum
- Source categorization (Local/Remote, Streaming, Multiroom support)
- Multiple account support (multiple Spotify accounts per device)
- Availability filtering (Ready vs Unavailable sources)
- Helper methods for quick capability checks

## Real Device Integration

- Fetched actual XML responses from SoundTouch devices (192.168.178.28 & 192.168.178.35)
- Updated all test fixtures with real device data (anonymized)
- Enhanced XML models to handle all real-world fields and edge cases
- Verified compatibility across different device types and configurations

## Enhanced CLI Tool

- Added -nowplaying command with rich formatted output
- Added -sources command with categorized source listing
- Display enhancements: duration info, capabilities, source attributes
- Improved build process to use ./build/ directory consistently

## Comprehensive Testing

- 15+ unit tests for XML models with enum validation
- Client integration tests with mock HTTP responses
- Real device response validation
- Edge case handling (empty states, network errors, invalid data)

## Documentation & Guidelines

- Updated CLAUDE.md with build directory and real device testing guidelines
- Enhanced README with comprehensive usage examples
- Updated PLAN.md to reflect implementation progress
- All examples use real device data patterns

## Quality Improvements

- Type-safe XML unmarshaling with custom validation
- Consistent error handling across all endpoints
- Privacy protection (anonymized account information)
- Production-ready code structure and patterns

Features:
 GET /info - Device information
 GET /now_playing - Current playback status with full metadata
 GET /sources - Available audio sources with smart categorization
 UPnP device discovery
 Cross-platform CLI tool with rich output formatting
 Comprehensive test coverage with real device data
 Build automation with proper directory structure
2026-01-08 23:21:01 +01:00
Tobias Gesellchen 7de6b8246b Initial commit: Bose SoundTouch API Client PoC
- Implement HTTP client with XML support for SoundTouch Web API
- Add UPnP device discovery with SSDP protocol
- Create type-safe Go models for API responses
- Build CLI tool with device discovery and info commands
- Add comprehensive configuration management via .env and env vars
- Include extensive documentation (API endpoints, patterns, development guide)
- Translate all German documentation to English
- Set up modern Go project structure with testing framework
- Add Makefile for cross-platform builds and development workflow

Features:
 Device discovery (UPnP + manual configuration)
 Device information retrieval
 XML request/response handling
 CLI interface with flexible device targeting
 Cross-platform compatibility
 Comprehensive test coverage with mock data
 Production-ready configuration management
2026-01-08 23:01:32 +01:00