hoffmation-base 3.2.3-alpha.6 → 3.2.3-alpha.8

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.
@@ -23,12 +23,13 @@ class BaseCommand {
23
23
  }
24
24
  get isAutomaticAction() {
25
25
  if (this.overrideCommandSource !== undefined) {
26
- return this.overrideCommandSource === enums_1.CommandSource.Automatic;
26
+ return (this.overrideCommandSource === enums_1.CommandSource.Automatic ||
27
+ this.overrideCommandSource === enums_1.CommandSource.ApiAutomatic);
27
28
  }
28
29
  if (typeof this.source === 'object') {
29
30
  return this.source.isAutomaticAction;
30
31
  }
31
- return this.source === enums_1.CommandSource.Automatic;
32
+ return this.source === enums_1.CommandSource.Automatic || this.source === enums_1.CommandSource.ApiAutomatic;
32
33
  }
33
34
  get isForceAction() {
34
35
  if (this.overrideCommandSource !== undefined) {
@@ -95,7 +95,7 @@ class CameraDevice extends RoomBaseDevice_1.RoomBaseDevice {
95
95
  }
96
96
  /** @inheritDoc */
97
97
  setPersonDetected() {
98
- this.onNewPersonDetectedValue(true, enums_1.CommandSource.API);
98
+ this.onNewPersonDetectedValue(true, enums_1.CommandSource.ApiAutomatic);
99
99
  }
100
100
  /** @inheritDoc */
101
101
  persistMotionSensor() {
@@ -11,17 +11,22 @@ export declare enum CommandSource {
11
11
  * This should mark all commands that are executed as an automatic response to a certain action/change.
12
12
  */
13
13
  Automatic = 2,
14
+ /**
15
+ * This should mark all commands/sources which resulted of an automatic api call, e.g an external service webhook.
16
+ * @type {CommandSource.ApiAutomatic}
17
+ */
18
+ ApiAutomatic = 3,
14
19
  /**
15
20
  * This should mark all commands that are executed by a user thus having a higher priority than other automatic commands.
16
21
  */
17
- Manual = 3,
22
+ Manual = 4,
18
23
  /**
19
24
  * This should mark all commands that are executed by an API call.
20
25
  * !WARNING! API could be an automatic call, but also a manual call e.g. using hoffmation-ios or homebridge-hoffmation --> So this is a higher priority than Automatic but still lower than manual/force.
21
26
  */
22
- API = 4,
27
+ API = 5,
23
28
  /**
24
29
  * This should mark all commands that have highest priority, thus overruling/ignoring certain controls/safety mechanisms.
25
30
  */
26
- Force = 5
31
+ Force = 6
27
32
  }
@@ -16,17 +16,22 @@ var CommandSource;
16
16
  * This should mark all commands that are executed as an automatic response to a certain action/change.
17
17
  */
18
18
  CommandSource[CommandSource["Automatic"] = 2] = "Automatic";
19
+ /**
20
+ * This should mark all commands/sources which resulted of an automatic api call, e.g an external service webhook.
21
+ * @type {CommandSource.ApiAutomatic}
22
+ */
23
+ CommandSource[CommandSource["ApiAutomatic"] = 3] = "ApiAutomatic";
19
24
  /**
20
25
  * This should mark all commands that are executed by a user thus having a higher priority than other automatic commands.
21
26
  */
22
- CommandSource[CommandSource["Manual"] = 3] = "Manual";
27
+ CommandSource[CommandSource["Manual"] = 4] = "Manual";
23
28
  /**
24
29
  * This should mark all commands that are executed by an API call.
25
30
  * !WARNING! API could be an automatic call, but also a manual call e.g. using hoffmation-ios or homebridge-hoffmation --> So this is a higher priority than Automatic but still lower than manual/force.
26
31
  */
27
- CommandSource[CommandSource["API"] = 4] = "API";
32
+ CommandSource[CommandSource["API"] = 5] = "API";
28
33
  /**
29
34
  * This should mark all commands that have highest priority, thus overruling/ignoring certain controls/safety mechanisms.
30
35
  */
31
- CommandSource[CommandSource["Force"] = 5] = "Force";
36
+ CommandSource[CommandSource["Force"] = 6] = "Force";
32
37
  })(CommandSource || (exports.CommandSource = CommandSource = {}));