I think the whole `pendingOperationsQueue` logic deserves a better abstraction (dedicated module)

```js
this.toggleAlarmQueue = new AsyncQueue();
...
// this would execute immediately or wait until previous "operations" completed
this.toggleAlarmQueue.add(toggleAlarmState);
```

that way we would have dedicated tests for this logic and could reuse in other places. - would simplify the logic