Couldn't we write this as 
```javascript
lock.set({'wifi.enabled': this.checked, 'wifi.suspended': !this.checked}).onerror = onSetError;
```
That looks more efficient although I have not tested it.