Closed Mariusmssj closed 4 years ago
list_devices()
calls GetActiveDevices()
, so that's why the AV receiver is not listed.
Also is there any example code of how to use cec.EVENT_COMMAND callback? I want to have a callback that will run once a device is turned off or on.
I'm using something like this with my TV:
def cmd(event, command):
if command['initiator'] == cec.CECDEVICE_TV and \
command['opcode'] == cec.CEC_OPCODE_REPORT_POWER_STATUS:
current_power_status = command['parameters'][0]
...
cec.add_callback(cmd, cec.EVENT_COMMAND)
cec.init()
cec.Device(cec.CECDEVICE_TV).transmit(cec.CEC_OPCODE_GIVE_DEVICE_POWER_STATUS)
That is brilliant. Thank you :)
Hello, Thank you for the great library it has really helped me out :) I ran into an issue and I was hoping you could help?
When I run code below I only get 5 devices back:
Which shows this:
However there is an AV Receiver that the raspberry pi is plugged into and if I run the following:
I get:
Which means it does see the receiver. Is the list_devices limited to how many it can return? Also is there any example code of how to use cec.EVENT_COMMAND callback? I want to have a callback that will run once a device is turned off or on.
Thank you