bencevans / node-sonos

🔈 Sonos Media Player Interface/Client
https://www.npmjs.com/package/sonos
MIT License
702 stars 147 forks source link

MAC address of the speaker #435

Closed jsponz closed 5 years ago

jsponz commented 5 years ago

Expected Behavior

I would need to get the MAC address of the speaker

Current Behavior

Possible Solution

Sample code or executed example

1. 2. 3. 4.

Versions (and Environment)

Node version: node-sonos version: OS:

jsponz commented 5 years ago

I share the solution:

device.getZoneInfo() .then(attrs2 => { console.log('Got zone info %j', attrs2) log.info('Found player (%s) with IP: %s and MAC: %s', model, device.host, attrs2.MACAddress) // hosts.push(host) var macCleaned = attrs2.MACAddress.replace(/:/g, '') device.mac = macCleaned log.info('Found player (%s) with MAC: %s', model, device.mac) }) .catch(err => { log.error('Get Zone error ', err) })