Skip to content

Instantly share code, notes, and snippets.

@cs3238-tsuzu cs3238-tsuzu/
Last active Jul 9, 2016

What would you like to do?
Marantz NR1604 Auto PowerOff
AVReciever = require('marantz-avr')
mdns = require('mdns')
CronJob = require('cron').CronJob
clients = []
new CronJob '0 0 0 * * *', ->
for key, val of clients
for ip in val
reciever = new AVReciever(ip)
, null, true, 'Asia/Tokyo'
ad = mdns.createAdvertisement(mdns.tcp('http'), 4321)
browser = mdns.createBrowser(mdns.tcp('raop')) # All Airplay Devices
browser.on 'serviceUp', (service)->
if /Marantz/
clients[] = service.addresses
browser.on 'serviceDown', (service)->
if /Marantz/ && clients[]?
delete clients[]
all = mdns.browseThemAll()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.