diff --git a/lib/ZPAccessory.js b/lib/ZPAccessory.js index cff9478..b0c6b95 100644 --- a/lib/ZPAccessory.js +++ b/lib/ZPAccessory.js @@ -142,32 +142,42 @@ ZPAccessory.prototype.copyCoordinator = function () { coordinator.becomePlatformCoordinator() this.log.debug('%s: copy group characteristics from %s', this.name, coordinator.name) if (this.state.group.on !== coordinator.state.group.on) { - this.log.debug('%s: set member power (play/pause) from %s to %s', this.name, - this.state.group.on, coordinator.state.group.on) + this.log.debug( + '%s: set member power (play/pause) from %s to %s', this.name, + this.state.group.on, coordinator.state.group.on + ) this.state.group.on = coordinator.state.group.on this.groupService.setCharacteristic(Characteristic.On, this.state.group.on) } if (this.state.group.volume !== coordinator.state.group.volume) { - this.log.debug('%s: set member group volume from %s to %s', this.name, - this.state.group.volume, coordinator.state.group.volume) + this.log.debug( + '%s: set member group volume from %s to %s', this.name, + this.state.group.volume, coordinator.state.group.volume + ) this.state.group.volume = coordinator.state.group.volume this.groupService.setCharacteristic(this.platform.VolumeCharacteristic, this.state.group.volume) } if (this.state.group.mute !== coordinator.state.group.mute) { - this.log.debug('%s: set member group mute from %s to %s', this.name, - this.state.group.mute, coordinator.state.group.mute) + this.log.debug( + '%s: set member group mute from %s to %s', this.name, + this.state.group.mute, coordinator.state.group.mute + ) this.state.group.mute = coordinator.state.group.mute this.groupService.setCharacteristic(Characteristic.Mute, this.state.group.mute) } if (this.state.group.track !== coordinator.state.group.track) { - this.log.debug('%s: set member track from %s to %s', this.name, - this.state.group.track, coordinator.state.group.track) + this.log.debug( + '%s: set member track from %s to %s', this.name, + this.state.group.track, coordinator.state.group.track + ) this.state.group.track = coordinator.state.group.track this.groupService.setCharacteristic(Characteristic.CurrentTrack, this.state.group.track) } if (this.state.group.name !== coordinator.state.group.name) { - this.log.debug('%s: set member sonos group from %s to %s', this.name, - this.state.group.name, coordinator.state.group.name) + this.log.debug( + '%s: set member sonos group from %s to %s', this.name, + this.state.group.name, coordinator.state.group.name + ) this.state.group.name = coordinator.state.group.name this.groupService.setCharacteristic(Characteristic.SonosGroup, this.state.group.name) } @@ -339,8 +349,10 @@ ZPAccessory.prototype.handleAVTransportEvent = function (data) { } if (track !== this.state.group.track && track !== 'ZPSTR_CONNECTING' && track !== 'ZPSTR_BUFFERING') { - this.log.info('%s: current track changed from %s to %s', this.name, - this.state.group.track, track) + this.log.info( + '%s: current track changed from %s to %s', this.name, + this.state.group.track, track + ) this.state.group.track = track this.groupService.setCharacteristic(Characteristic.CurrentTrack, this.state.group.track) for (const member of this.members()) { @@ -778,8 +790,10 @@ ZPAccessory.prototype.resubscribe = function (sid, device, service) { }.bind(this)) return } - this.log.debug('%s: renewed %s subscription %s (timeout %s)', this.name, - service, response.headers.sid, response.headers.timeout) + this.log.debug( + '%s: renewed %s subscription %s (timeout %s)', this.name, + service, response.headers.sid, response.headers.timeout + ) setTimeout(function () { this.resubscribe(response.headers.sid, device, service) }.bind(this), (this.platform.subscriptionTimeout - 60) * 1000) @@ -796,8 +810,10 @@ ZPAccessory.prototype.request = function (opt, callback) { return callback(err) } if (response.statusCode !== 200) { - this.log.error('%s: cannot %s %s (%d - %s)', this.name, opt.method, opt.url, - response.statusCode, response.statusMessage) + this.log.error( + '%s: cannot %s %s (%d - %s)', this.name, opt.method, opt.url, + response.statusCode, response.statusMessage + ) return callback(response.statusCode) } return callback(null, response) diff --git a/lib/ZPPlatform.js b/lib/ZPPlatform.js index 1ede137..a149552 100644 --- a/lib/ZPPlatform.js +++ b/lib/ZPPlatform.js @@ -220,10 +220,10 @@ function ZPPlatform (log, config) { } this.speakers = config.speakers || false this.alarms = config.alarms || false - this.searchTimeout = config.searchTimeout || 5 // seconds - this.searchTimeout *= 1000 // milliseconds - this.subscriptionTimeout = config.subscriptionTimeout || 30 // minutes - this.subscriptionTimeout *= 60 // seconds + this.searchTimeout = config.searchTimeout || 5 // seconds + this.searchTimeout *= 1000 // milliseconds + this.subscriptionTimeout = config.subscriptionTimeout || 30 // minutes + this.subscriptionTimeout *= 60 // seconds this.players = [] this.zpAccessories = {}