I am trying now to add some support for the PU remote control. Found that it basically behaves as a Hub. The difference with other hubs is that it has no external connectors, and has two internally-connected peripherals, the two button sets at left and right. It has internal LED and voltage peripherals as the other hubs, but no current (which makes sense since it is not driving any external device).
I managed to create a slightly modified version of the SmartHub class, with which I can successfully control the LED and take voltage readings. However, the button sets are supposed to be associated with ports 0 and 1 (as per output of the describe_possible_modes method), but they don't work. When I associate a Button instance to either port 0 or 1, I get no response from any of the buttons in the left and right sets, but I do get instead a response from the main (green) hub button. Which is not associated to anything in my code.
I suspect either there is a mixup of the ports somehow, or I'm missing something in the way the messages are passed to/from the BLE interface.
I confirmed the ports 0 and 1 assignations for this device by looking at what other packages do (bricknil and node-poweredup). I can provide the output of the describe_possible_modes method, as well as my dev code (it's in a fork of this project).
The bricknil documentation has a nice break up of the responses expected from each button in the remote https://virantha.github.io/bricknil/lego_api/lego.html#remote-buttons
I am trying now to add some support for the PU remote control. Found that it basically behaves as a Hub. The difference with other hubs is that it has no external connectors, and has two internally-connected peripherals, the two button sets at left and right. It has internal LED and voltage peripherals as the other hubs, but no current (which makes sense since it is not driving any external device).
I managed to create a slightly modified version of the
SmartHubclass, with which I can successfully control the LED and take voltage readings. However, the button sets are supposed to be associated with ports 0 and 1 (as per output of thedescribe_possible_modesmethod), but they don't work. When I associate aButtoninstance to either port 0 or 1, I get no response from any of the buttons in the left and right sets, but I do get instead a response from the main (green) hub button. Which is not associated to anything in my code.I suspect either there is a mixup of the ports somehow, or I'm missing something in the way the messages are passed to/from the BLE interface.
I confirmed the ports 0 and 1 assignations for this device by looking at what other packages do (bricknil and node-poweredup). I can provide the output of the
describe_possible_modesmethod, as well as my dev code (it's in a fork of this project).The bricknil documentation has a nice break up of the responses expected from each button in the remote https://virantha.github.io/bricknil/lego_api/lego.html#remote-buttons