I have modified a homebridge plugin to use the speaker service in order to control the mute and volume of my Pioneer AVR, however when I launch homebridge I am told that Speaker.Service is not a function:
TypeError: Service.Speaker is not a function
at new VSX (/usr/local/lib/node_modules/homebridge-vsx/index.js:24:26)
at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:244:29)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:72:38)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
Nevermind. Turns out Homebridge uses an old version of HAP-NodeJS. I was looking at the globally installed version of HAP-NodeJS which was not missing this service.
I have modified a homebridge plugin to use the speaker service in order to control the mute and volume of my Pioneer AVR, however when I launch homebridge I am told that Speaker.Service is not a function:
I am using it in this way:
Service.Switch works perfectly fine. Any ideas what's wrong?