Repository navigation
1.1.0
🎉 What's New
Real-time Speaker Monitoring - SwiftKEF now supports continuous event streaming! Monitor your KEF speakers in real-time with the new polling
API that instantly detects:
- 🔊 Volume changes
- 🎵 Track changes and playback state
- ⏱️ Live song position updates
- 📡 Source switching
- 🔌 Power state changes
✨ Key Features
Event Polling API
// Get instant updates when speaker state changes
let eventStream = speaker.startPolling(pollInterval: 10, pollSongStatus: true)
for try await event in eventStream {
if let volume = event.volume {
print("Volume changed: \(volume)")
}
if let position = event.songPosition {
print("Playback position: \(position)ms")
}
}New Public Methods
- pollSpeaker(timeout:pollSongStatus:) - Single poll for current events
- startPolling(pollInterval:pollSongStatus:) - Continuous event stream
- getSongPosition() - Get current playback position in milliseconds
- getSongDuration() - Get track duration in milliseconds
🔧 Improvements
- Zero Latency Updates - Events are delivered immediately when changes occur
- Efficient Polling - Smart queue management with automatic reconnection
- Playback Tracking - Optional real-time song position monitoring
- Type-Safe Events - New KEFSpeakerEvent struct with all status fields
- Better Error Handling - Graceful recovery from network interruptions
📦 New Types
- KEFSpeakerEvent - Consolidated event data from polling
- PlaybackState - Track playback states (playing/paused/stopped)
🚀 Example Use Cases
Perfect for building:
- Real-time volume sliders that sync with speaker changes
- Live playback progress bars
- Multi-room audio synchronization
- Speaker monitoring dashboards
- Home automation integrations
💻 Compatibility
- Swift 6.1+
- macOS 10.15+ / iOS 13+ / tvOS 13+ / watchOS 6+
- Fully backward compatible - existing code continues to work
Full Changelog: v1.0.1...v1.1.0