The following code fragment appears to work, but not for both of my devices. I have a varia rear radar light and a bontrager ion headlight.
The call to getBatteryStatus always returns null for the varia rear radar light. Is there a different or better way to obtain the battery
status of the individual lights that are part of a network?
lightListener = new AP.LightNetworkListener();
light = new AP.LightNetwork(lightListener);
var lights = light.getBikeLights();
var state = light.getNetworkState();
for (var i=0; i<lights.size(); i++) {
var batt = light.getBatteryStatus(i);
}
Note: I also have 2 powertap rear hubs where one unit can obtain the battery status and the other cannot.