scholtzan / homebridge-rusty-spotify

Spotify plugin for Homebridge written in Rust
MIT License
14 stars 5 forks source link

Errors getting volume and playback states #4

Open pponce opened 4 years ago

pponce commented 4 years ago

Just in case you are not aware. I'm seeing these errors in my log show up pretty consistently. Doesn't seem to cause an issue that is visible. Error getting volume state: JsValue(Object({"message":"invalid json response body at https://api.spotify.com/v1/me/player reason: Unexpected end of JSON input","type":"invalid-json"})) Error getting playback state: JsValue(Object({"message":"invalid json response body at https://api.spotify.com/v1/me/player reason: Unexpected end of JSON input","type":"invalid-json"}))

scholtzan commented 3 years ago

Strange, I haven't seen these myself. I also just pushed an update of the plugin, so maybe that'll fix it.

dotWee commented 3 years ago

After playing around a bit I've noticed this error appears when no device is currently playing.

I haven't looked into the source code yet, but maybe a "empty" API response (with no Spotify Player being active recently) doesn't get handled correctly.

scholtzan commented 3 years ago

This should be fixed in the new 0.4.3 version. The plugin wasn't handling the case correctly when there were no active Spotify devices.

kylewhirl commented 2 years ago

This is also an issue with iPhones particularly (not sure about Android Phones). You cannot get the volume state using the Spotify API if you are listening on an iPhone