def power(dev, mode):
    if dev not in address_():
        raise CommandExecutionError('Invalid dev passed to bluetooth.power')

    if mode == 'on' or mode is True:
        state = 'up'
        mode = 'on'
    else:
        state = 'down'
        mode = 'off'
    cmd = 'hciconfig {0} {1}'.format(dev, state)
    __salt__['cmd.run'](cmd).splitlines()
    info = address_()
    if info[dev]['power'] == mode:
        return True
    return False
Power a bluetooth device on or off
dataset/ETHPy150Open saltstack/salt/salt/modules/bluez.py/power