'Send commands to API.'

def _put_command(self, func, arg=None):

    params = {'access_token': self.access_token}
    if arg:
        params['command'] = arg
    url = '{}/v1/devices/{}/{}'.format(self.particle_url, self.device_id, func)
    ret = requests.post(url, data=params, timeout=10)
    return ret.json()
