Skip to content

Commit

Permalink
DeviceProperties loggin
Browse files Browse the repository at this point in the history
See #74.
  • Loading branch information
ebaauw committed May 30, 2019
1 parent 0eb75f4 commit c8ccaf1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions lib/ZpAccessory.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ function ZpAccessory (platform, zp) {
this.alarmClock = new SonosModule.Services.AlarmClock(this.zp.host, this.zp.port)

this.on('GroupManagement', this.handleGroupManagementEvent)
this.on('DeviceProperties', this.handleDevicePropertiesEvent)
this.on('AVTransport', this.handleAVTransportEvent)
this.on('RenderingControl', this.handleRenderingControlEvent)
this.on('GroupRenderingControl', this.handleGroupRenderingControlEvent)
Expand Down Expand Up @@ -390,6 +391,11 @@ ZpAccessory.prototype.createSubscriptions = function () {
member.log.info('%s: member of group %s', member.name, member.coordinator.name)
member.copyCoordinator()
}
this.subscribe('DeviceProperties', (err) => {
if (err) {
this.log.error('%s: subscribe to DeviceProperties events: %s', this.name, err)
}
})
this.subscribe('MediaRenderer/AVTransport', (err) => {
if (err) {
this.log.error('%s: subscribe to AVTransport events: %s', this.name, err)
Expand Down Expand Up @@ -453,6 +459,10 @@ ZpAccessory.prototype.handleGroupManagementEvent = function (data) {
}
}

ZpAccessory.prototype.handleDevicePropertiesEvent = function (data) {
this.log('%s: DeviceProperties event: %j', this.name, data)
}

ZpAccessory.prototype.handleAVTransportEvent = function (data) {
this.log.debug('%s: AVTransport event', this.name)
this.parser.parseString(data.LastChange, (err, json) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/ZpPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ ZpPlatform.prototype.findPlayers = function () {
if (err) {
this.log.error('%s: error %s', zp.zone, err)
} else {
// this.log.debug('%s: info %j', zp.zone, info)
this.log('%s: info %j', zp.zone, info)
zp.id = 'RINCON_' + info.MACAddress.replace(/:/g, '') +
('00000' + zp.port).substr(-5, 5)
zp.version = info.DisplaySoftwareVersion
Expand Down

0 comments on commit c8ccaf1

Please sign in to comment.