node-sonos-discovery icon indicating copy to clipboard operation
node-sonos-discovery copied to clipboard

Unable to get state of player

Open ryjohnson opened this issue 4 years ago • 0 comments

Everything was working great up until yesterday. Now whenever I play a track through Spotify (Sonos App, AirPlay, Spotify Connect), I can't get the current state of the player (play/pause, current track, etc). Looking at the avTransportUriMetadata, for some reason, it keeps thinking I'm using line-in.

'<DIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns:r="urn:schemas-rinconnetworks-com:metadata-1-0/" xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"><item id="spotify" parentID="0" restricted="false"><dc:title>Spotify</dc:title>**<upnp:class>object.item.audioItem.linein</upnp:class>**<res protocolInfo="x-sonos-vli:*:audio:*">x-sonos-vli:RINCON_347E5C0EE19701400:2,spotify:5e9de992040a26982081102f3cf2b1b0</res><vli cookie="1" group=""></vli></item></DIDL-Lite>'
const SonosDiscovery = require('sonos-discovery');

const settings = {
  port: 1234,
  cacheDir: './cache',
};

const discovery = new SonosDiscovery(settings);

discovery.on('initialized', function(data) {
  console.log('EVENT: initialized');
});

discovery.on('topology-change', function(data) {
  console.log('EVENT: topology-change');
});

discovery.on('transport-state', function(data) {
  console.log('EVENT: transport-state');
  console.log(discovery.zones);
});

ryjohnson avatar Mar 14 '20 23:03 ryjohnson