brilliantsole 0.0.19 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -323,13 +323,16 @@ class Timer {
323
323
  get isRunning() {
324
324
  return __classPrivateFieldGet(this, _Timer_intervalId, "f") != undefined;
325
325
  }
326
- start() {
326
+ start(immediately = false) {
327
327
  if (this.isRunning) {
328
328
  _console$z.log("interval already running");
329
329
  return;
330
330
  }
331
331
  _console$z.log("starting interval");
332
332
  __classPrivateFieldSet(this, _Timer_intervalId, setInterval(__classPrivateFieldGet(this, _Timer_callback, "f"), __classPrivateFieldGet(this, _Timer_interval, "f")), "f");
333
+ if (immediately) {
334
+ __classPrivateFieldGet(this, _Timer_callback, "f").call(this);
335
+ }
333
336
  }
334
337
  stop() {
335
338
  if (!this.isRunning) {
@@ -340,9 +343,9 @@ class Timer {
340
343
  clearInterval(__classPrivateFieldGet(this, _Timer_intervalId, "f"));
341
344
  __classPrivateFieldSet(this, _Timer_intervalId, undefined, "f");
342
345
  }
343
- restart() {
346
+ restart(startImmediately = false) {
344
347
  this.stop();
345
- this.start();
348
+ this.start(startImmediately);
346
349
  }
347
350
  }
348
351
  _Timer_callback = new WeakMap(), _Timer_interval = new WeakMap(), _Timer_intervalId = new WeakMap();
@@ -4870,12 +4873,13 @@ class DevicePair {
4870
4873
  __classPrivateFieldGet(this, _DevicePair_instances, "a", _DevicePair_dispatchEvent_get).call(this, "deviceIsConnected", { device, isConnected: device.isConnected, side });
4871
4874
  return currentDevice;
4872
4875
  }
4873
- setSensorConfiguration(sensorConfiguration) {
4874
- InsoleSides.forEach((side) => {
4876
+ async setSensorConfiguration(sensorConfiguration) {
4877
+ for (let i = 0; i < InsoleSides.length; i++) {
4878
+ const side = InsoleSides[i];
4875
4879
  if (this[side]?.isConnected) {
4876
- this[side]?.setSensorConfiguration(sensorConfiguration);
4880
+ await this[side].setSensorConfiguration(sensorConfiguration);
4877
4881
  }
4878
- });
4882
+ }
4879
4883
  }
4880
4884
  resetPressureRange() {
4881
4885
  __classPrivateFieldGet(this, _DevicePair_sensorDataManager, "f").resetPressureRange();