diff --git a/lib/ZpAccessory.js b/lib/ZpAccessory.js index ddc128e..44835df 100644 --- a/lib/ZpAccessory.js +++ b/lib/ZpAccessory.js @@ -50,6 +50,7 @@ function setHomebridge (Homebridge) { const tvModels = [ 'ZPS9', // PlayBar. 'ZPS11', // Playbase, see #58. + 'ZPS14', // Beam, see #74. 'ZPS16' // Amp, see #8. ] @@ -77,9 +78,6 @@ function ZpAccessory (platform, zp) { } this.log = this.platform.log this.parser = new xml2js.Parser() - if (this.tv !== this.zp.tv) { - this.log.warn('%s: warning: TV detection fails for %s: tv: %j, zp.tv: %j', this.name, this.zp.model, this.tv, this.zp.tv) - } this.infoService = new Service.AccessoryInformation() this.infoService @@ -460,7 +458,27 @@ ZpAccessory.prototype.handleGroupManagementEvent = function (data) { } ZpAccessory.prototype.handleDevicePropertiesEvent = function (data) { - this.log('%s: DeviceProperties event: %j', this.name, data) + this.log.debug('%s: DeviceProperties event: %j', this.name, data) + if (this.capabilities == null) { + const caps = { + airPlay: data.AirPlayEnabled != null && data.AirPlayEnabled !== '0', + audioIn: data.SupportsAudioIn != null && data.SupportsAudioIn !== '0', + tvIn: data.HTFreq != null, + homeTheatreSetup: data.HTSatChanMapSet != null && data.HTSatChanMapSet !== '', + stereoPair: data.ChannelMapSet != null && data.ChannelMapSet !== '' + } + this.log.warn( + '%s: detected %s capabilities (please report if wrong): ' + + 'AirPlay: %j, audio input: %j, TV input: %j', + this.name, this.zp.model, caps.airPlay, caps.audioIn, caps.tvIn + ) + this.log.warn( + '%s: detected setup (please report if wrong): ' + + 'Home Theatre: %j, Stereo Pair: %j', + this.name, caps.homeTheatreSetup, caps.stereoPair + ) + this.capabities = caps + } } ZpAccessory.prototype.handleAVTransportEvent = function (data) { diff --git a/lib/ZpPlatform.js b/lib/ZpPlatform.js index be1d7f1..5fe7cf6 100644 --- a/lib/ZpPlatform.js +++ b/lib/ZpPlatform.js @@ -270,11 +270,10 @@ ZpPlatform.prototype.findPlayers = function () { if (err) { this.log.error('%s: error %s', zp.zone, err) } else { - this.log('%s: info %j', zp.zone, info) + // this.log.debug('%s: info %j', zp.zone, info) zp.id = 'RINCON_' + info.MACAddress.replace(/:/g, '') + ('00000' + zp.port).substr(-5, 5) zp.version = info.DisplaySoftwareVersion - zp.tv = Number(info.HTAudioIn) > 0 zoneGroupTopology.GetZoneGroupAttributes({}, (err, attrs) => { if (err) { this.log.error('%s: error %s', zp.zone, err)