incyclist-services 1.0.50 → 1.0.52

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.
@@ -341,6 +341,7 @@ class DevicePairingService extends service_2.IncyclistService {
341
341
  }
342
342
  emitStateChange(newState) {
343
343
  const { onStateChanged, onDeviceSelectStateChanged } = this.settings || {};
344
+ this.checkCanStart();
344
345
  if (this.state.stopRequested)
345
346
  return;
346
347
  const state = this.getExternaState(newState);
@@ -351,6 +352,7 @@ class DevicePairingService extends service_2.IncyclistService {
351
352
  onDeviceSelectStateChanged(this.getDeviceSelectionState());
352
353
  }
353
354
  onInterfaceConfigChanged(ifName, settings) {
355
+ this.logEvent({ message: 'Interface Config changed', interface: ifName, settings });
354
356
  const prev = this.state.interfaces;
355
357
  if (!prev)
356
358
  return;
@@ -372,6 +374,9 @@ class DevicePairingService extends service_2.IncyclistService {
372
374
  else {
373
375
  return;
374
376
  }
377
+ current.enabled = settings.enabled;
378
+ current.port = settings.port;
379
+ current.protocol = settings.protocol;
375
380
  this.emitStateChange();
376
381
  }
377
382
  catch (err) {
@@ -392,6 +397,7 @@ class DevicePairingService extends service_2.IncyclistService {
392
397
  Object.assign(current, Object.assign({}, newState), connectState, value, unit);
393
398
  }
394
399
  onConfigurationUpdate(newCapabilities) {
400
+ this.logEvent({ message: 'Capability Config changed', capabilities: newCapabilities });
395
401
  try {
396
402
  const { capabilities } = this.state || {};
397
403
  const keys = Object.keys(newCapabilities);
@@ -651,8 +657,10 @@ class DevicePairingService extends service_2.IncyclistService {
651
657
  try {
652
658
  const prev = this.state.canStartRide;
653
659
  const configReadyToRide = this.configuration.canStartRide();
654
- if (!configReadyToRide)
660
+ if (!configReadyToRide) {
661
+ this.state.canStartRide = false;
655
662
  return false;
663
+ }
656
664
  const control = this.getCapability(incyclist_devices_1.IncyclistCapability.Control);
657
665
  const power = this.getCapability(incyclist_devices_1.IncyclistCapability.Power);
658
666
  const canStartRide = ((control === null || control === void 0 ? void 0 : control.connectState) !== 'failed' || (power === null || power === void 0 ? void 0 : power.connectState) !== 'failed');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "incyclist-services",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "peerDependencies": {
5
5
  "gd-eventlog": "^0.1.24"
6
6
  },