Merge pull request #144 from luxus/patch-1

adding resolver chain workaround for raspberry pi
This commit is contained in:
Nick Farina
2015-09-06 15:40:24 -07:00

View File

@@ -1,13 +1,19 @@
var types = require("HAP-NodeJS/accessories/types.js");
var Yamaha = require('yamaha-nodejs');
var mdns = require('mdns');
//workaround for raspberry pi
var sequence = [
mdns.rst.DNSServiceResolve(),
'DNSServiceGetAddrInfo' in mdns.dns_sd ? mdns.rst.DNSServiceGetAddrInfo() : mdns.rst.getaddrinfo({families:[4]}),
mdns.rst.makeAddressesUnique()
];
function YamahaAVRPlatform(log, config){
this.log = log;
this.config = config;
this.playVolume = config["play_volume"];
this.setMainInputTo = config["setMainInputTo"];
this.browser = mdns.createBrowser(mdns.tcp('http'));
this.browser = mdns.createBrowser(mdns.tcp('http'), {resolverSequence: sequence});
}
YamahaAVRPlatform.prototype = {