Added support for turning on and off devices