Skip to content

Commit

Permalink
mafintosh#26 🐛 Different Google Cast devices
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsaulnier committed Jan 2, 2017
1 parent 9599b46 commit 1ba9b57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,15 @@ module.exports = function () {
dns.on('response', function (response) {
response.answers.forEach(function (a) {
if (a.type === 'PTR' && a.name === '_googlecast._tcp.local') {
var name = a.data.replace('._googlecast._tcp.local', '')
var name = a.data.replace('._googlecast._tcp.local', '').replace('Chromecast-', '')
if (!casts[name]) casts[name] = {name: name, host: null}
}
})

var onanswer = function (a) {
debug('got answer %j', a)

var name = a.name.replace('.local', '')
var name = a.name.replace('.local', '').replace(/-/g, '')
if (a.type === 'A' && casts[name] && !casts[name].host) {
casts[name].host = a.data
emit(casts[name])
Expand Down

0 comments on commit 1ba9b57

Please sign in to comment.