Closed ageorgios closed 5 years ago
Hello,
I have already coded a homebridge plugin for my TV but I am transitioning to your implementation. Although I have a better state management proposal as below:
this.serviceManager .getCharacteristic(Characteristic.Active) .on('get', (callback) => { const { config, state } = this; let { tvhost } = config; sping.sys.probe(tvhost, (isActive) => { if (isActive) { return callback(null, 1); } else { return callback(null,0) } }, {"min_reply": 1}) }) .on('set', (active, callback) => { if (active) { this.setSwitchState(on) } else { this.setSwitchState(off) } callback() });
This is just a fork. I used the code style from the original author.
Hello,
I have already coded a homebridge plugin for my TV but I am transitioning to your implementation. Although I have a better state management proposal as below: