An example of how to write a device that implements on / off