[Release] Sonos Advanced Controller

Alright, more performance fixes here:

Looks like JsonSlurper isn't thread-safe and uses a shared character buffer internally, and since Hubitat runs all the instances of a particular driver on the same JVM (and thus sharing the same global scope fields), there may have been issues there. A 'thundering stampede' issue, where multiple devices might have been fiddling with the same internal character map at the same time. So I changed it to instead give separate instances of JsonSlurper to each device. They're still getting re-used, which helps performance, but now it's just re-used per Player, rather than per Hubitat.

There's also a number of other changes, cacheing the favorites and playlists and updating it once a day (or on-demand, there's a button/command you can click if you need an immediate update of either). Previously it was re-querying these every track change. I don't know about the rest of you, but I'm not changing my favorites anywhere near that often.

Moved a few other things around, so they're more sensible. Stuff that only needs ran 'at device creation' was moved out of 'per hub reboot' path.

Also cached the TTS voices, updated at hub boot. There's no button to update that since it won't need it, as these voices would only change during a hub update, which requires a hub boot.

Let me know @bobbles and @guy.mayhew if there's still issues.

1 Like