This is a library that uses the serialport
to control various HDMI switchers. Primary use currently is for a library for (Homebridge)[https://github.com/emptygalaxy/homebridge-hdmi-switch].
- Run
npm install
in the root of the directory. - Run
npm run build
- Ensure that your configuration is correct in test.js
- Run
node test.js
- Observe HDMI Switcher
let device: HDMISwitch = new HDMISwitch('/dev/cu.usbserial-145420')
device.setInputIndex(1);
You can also supply a options object to the constructor to customize the behavior of the switcher.
The following example is for a Xantech XT-SW41-4K18G:
new HDMISwitch(
'/dev/cu.usbserial-145420',
{
Baud: 57600,
ZeroIndexed: false,
CommandEnd: '\r',
MaxInputs: 4,
Commands: {
PowerOn: 'OUTON',
PowerOff: 'OUTOFF',
OutputSelect: 'OUT FR %d',
}
}
);