patlux / node-cec

cec-client wrapper in nodejs
30 stars 6 forks source link

sending command examples #5

Closed santiDotIO closed 3 years ago

santiDotIO commented 7 years ago

Hi, can you provide some example of sending command, or explain a little more? for example sending input change commands etc.

patlux commented 7 years ago

To be honest: I don't know if its possible to change the input source programmatically. Maybe its possible when you send a "fake"-wakeup command to the tv, the tv should then change its input source to the new source.

See http://www.cec-o-matic.com/: 2017-03-06-212622_1776x721_scrot

santiDotIO commented 7 years ago

I been playing with this library, first off thank you so much for creating it! I think what would help if there was better documentation of the methods avaliblee. For example, in your basic.js you have an example of client.sendCommand which hints that it's only usable inside the ready callback

but looking at the source code client is just an instance of cec vairable.

Also the .send method should be documented. While most commands you send with tx xx:xx:xx you can send other commands with cec like scan and sendCommand prefixes the tx

santiDotIO commented 7 years ago

Also the different listener I notice a few are handled differently https://github.com/patlux/node-cec/blob/master/src/node-cec.coffee#L137-L154 or how their event listeners for all Opcode