Suggest to use the settings cache to get the result more quickly:
```
Settings.getSettings(function(results) {
  var wifiEnabled = results['wifi.enabled'];
  if (enabled !== enabled) {
    settings.createLock().set({'wifi.enabled': enabled});
  }
});
```