Adding on method to device and spark

Documentation here: https://github.com/spark/docs/pull/223