change code to use onoff instead of native-gpio
refactor test