hoffmation-base 3.2.1-alpha.5 → 3.2.1-alpha.6
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.
- package/lib/action/actuatorChangeAction.js +1 -1
- package/lib/action/baseAction.d.ts +2 -1
- package/lib/action/baseAction.js +1 -2
- package/lib/action/batteryLevelChangeAction.js +1 -1
- package/lib/action/handleChangeAction.js +1 -1
- package/lib/action/humiditySensorChangeAction.js +1 -1
- package/lib/action/motionSensorAction.js +1 -1
- package/lib/action/presenceGroupAnyMovementAction.d.ts +2 -2
- package/lib/action/presenceGroupFirstEnterAction.d.ts +2 -2
- package/lib/action/presenceGroupLastLeftAction.d.ts +2 -2
- package/lib/action/shutterPositionChangedAction.js +1 -1
- package/lib/action/temperatureSensorChangeAction.js +1 -1
- package/lib/command/baseCommand.js +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ const baseAction_1 = require("./baseAction");
|
|
|
5
5
|
const enums_1 = require("../enums");
|
|
6
6
|
class ActuatorChangeAction extends baseAction_1.BaseAction {
|
|
7
7
|
constructor(device) {
|
|
8
|
-
super(
|
|
8
|
+
super(enums_1.CommandSource.Automatic, `New Actuator state (${device.actuatorOn}) received`);
|
|
9
9
|
/** @inheritDoc */
|
|
10
10
|
this.type = enums_1.CommandType.ActuatorChangeAction;
|
|
11
11
|
this.actuatorOn = device.actuatorOn;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '../command';
|
|
2
|
+
import { CommandSource } from '../enums';
|
|
2
3
|
export declare abstract class BaseAction extends BaseCommand {
|
|
3
|
-
protected constructor(source
|
|
4
|
+
protected constructor(source: BaseAction | CommandSource, reason?: string);
|
|
4
5
|
get logMessage(): string;
|
|
5
6
|
}
|
package/lib/action/baseAction.js
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseAction = void 0;
|
|
4
4
|
const command_1 = require("../command");
|
|
5
|
-
const enums_1 = require("../enums");
|
|
6
5
|
class BaseAction extends command_1.BaseCommand {
|
|
7
6
|
constructor(source, reason) {
|
|
8
|
-
super(source
|
|
7
|
+
super(source, reason);
|
|
9
8
|
}
|
|
10
9
|
get logMessage() {
|
|
11
10
|
return this.reasonTrace;
|
|
@@ -5,7 +5,7 @@ const baseAction_1 = require("./baseAction");
|
|
|
5
5
|
const enums_1 = require("../enums");
|
|
6
6
|
class BatteryLevelChangeAction extends baseAction_1.BaseAction {
|
|
7
7
|
constructor(device) {
|
|
8
|
-
super(
|
|
8
|
+
super(enums_1.CommandSource.Automatic, `New Battery Level (${device.batteryLevel}%) received`);
|
|
9
9
|
/** @inheritDoc */
|
|
10
10
|
this.type = enums_1.CommandType.BatteryManagerLevelChangeAction;
|
|
11
11
|
this.newLevel = device.batteryLevel;
|
|
@@ -5,7 +5,7 @@ const baseAction_1 = require("./baseAction");
|
|
|
5
5
|
const enums_1 = require("../enums");
|
|
6
6
|
class HandleChangeAction extends baseAction_1.BaseAction {
|
|
7
7
|
constructor(handle) {
|
|
8
|
-
super(
|
|
8
|
+
super(enums_1.CommandSource.Automatic, `${handle.customName} ${handle.position === enums_1.WindowPosition.closed ? 'opened' : 'closed'}`);
|
|
9
9
|
/** @inheritDoc */
|
|
10
10
|
this.type = enums_1.CommandType.HandleChangedAction;
|
|
11
11
|
this.handle = handle;
|
|
@@ -5,7 +5,7 @@ const baseAction_1 = require("./baseAction");
|
|
|
5
5
|
const enums_1 = require("../enums");
|
|
6
6
|
class HumiditySensorChangeAction extends baseAction_1.BaseAction {
|
|
7
7
|
constructor(sensor, newHumidity) {
|
|
8
|
-
super(
|
|
8
|
+
super(enums_1.CommandSource.Automatic, `${sensor.customName} detected ${newHumidity} humidity`);
|
|
9
9
|
/** @inheritDoc */
|
|
10
10
|
this.type = enums_1.CommandType.HumiditySensorChangeAction;
|
|
11
11
|
this.newHumidity = newHumidity;
|
|
@@ -5,7 +5,7 @@ const baseAction_1 = require("./baseAction");
|
|
|
5
5
|
const enums_1 = require("../enums");
|
|
6
6
|
class MotionSensorAction extends baseAction_1.BaseAction {
|
|
7
7
|
constructor(sensor) {
|
|
8
|
-
super(
|
|
8
|
+
super(enums_1.CommandSource.Automatic, `${sensor.customName} ${sensor.movementDetected ? 'detected' : 'cleared'} motion`);
|
|
9
9
|
/** @inheritDoc */
|
|
10
10
|
this.type = enums_1.CommandType.MotionSensorAction;
|
|
11
11
|
this.motionDetected = sensor.movementDetected;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseAction } from './baseAction';
|
|
2
|
-
import { CommandType } from '../enums';
|
|
2
|
+
import { CommandSource, CommandType } from '../enums';
|
|
3
3
|
export declare class PresenceGroupAnyMovementAction extends BaseAction {
|
|
4
4
|
/** @inheritDoc */
|
|
5
5
|
type: CommandType;
|
|
6
|
-
constructor(source
|
|
6
|
+
constructor(source: BaseAction | CommandSource, reason?: string);
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseAction } from './baseAction';
|
|
2
|
-
import { CommandType } from '../enums';
|
|
2
|
+
import { CommandSource, CommandType } from '../enums';
|
|
3
3
|
export declare class PresenceGroupFirstEnterAction extends BaseAction {
|
|
4
4
|
/** @inheritDoc */
|
|
5
5
|
type: CommandType;
|
|
6
|
-
constructor(source
|
|
6
|
+
constructor(source: BaseAction | CommandSource, reason?: string);
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { CommandType } from '../enums';
|
|
1
|
+
import { CommandSource, CommandType } from '../enums';
|
|
2
2
|
import { BaseAction } from './baseAction';
|
|
3
3
|
export declare class PresenceGroupLastLeftAction extends BaseAction {
|
|
4
4
|
/** @inheritDoc */
|
|
5
5
|
type: CommandType;
|
|
6
|
-
constructor(source
|
|
6
|
+
constructor(source: BaseAction | CommandSource, reason?: string);
|
|
7
7
|
}
|
|
@@ -5,7 +5,7 @@ const baseAction_1 = require("./baseAction");
|
|
|
5
5
|
const enums_1 = require("../enums");
|
|
6
6
|
class ShutterPositionChangedAction extends baseAction_1.BaseAction {
|
|
7
7
|
constructor(shutter, newPosition) {
|
|
8
|
-
super(
|
|
8
|
+
super(enums_1.CommandSource.Automatic, `${shutter.customName} changed position to ${newPosition}`);
|
|
9
9
|
this.newPosition = newPosition;
|
|
10
10
|
/** @inheritDoc */
|
|
11
11
|
this.type = enums_1.CommandType.ShutterPositionChangedAction;
|
|
@@ -5,7 +5,7 @@ const baseAction_1 = require("./baseAction");
|
|
|
5
5
|
const enums_1 = require("../enums");
|
|
6
6
|
class TemperatureSensorChangeAction extends baseAction_1.BaseAction {
|
|
7
7
|
constructor(sensor, newTemperature) {
|
|
8
|
-
super(
|
|
8
|
+
super(enums_1.CommandSource.Automatic, `${sensor.customName} detected ${newTemperature} °C`);
|
|
9
9
|
/** @inheritDoc */
|
|
10
10
|
this.type = enums_1.CommandType.TemperatureSensorChangeAction;
|
|
11
11
|
this.newTemperature = newTemperature;
|
|
@@ -67,7 +67,7 @@ class BaseCommand {
|
|
|
67
67
|
if (this.ignoreReason !== undefined) {
|
|
68
68
|
ownPart += ` ignored due to: "${this.ignoreReason}"`;
|
|
69
69
|
}
|
|
70
|
-
if (this.source
|
|
70
|
+
if (this.source instanceof BaseCommand) {
|
|
71
71
|
return `${this.source.reasonTrace} -> ${ownPart}`;
|
|
72
72
|
}
|
|
73
73
|
return `CommandType("${enums_1.CommandSource[this.source]}") stack => ${ownPart}`;
|
|
@@ -76,7 +76,7 @@ class BaseCommand {
|
|
|
76
76
|
if (this.type === type) {
|
|
77
77
|
return true;
|
|
78
78
|
}
|
|
79
|
-
if (this.source
|
|
79
|
+
if (this.source instanceof BaseCommand) {
|
|
80
80
|
return this.source.containsType(type);
|
|
81
81
|
}
|
|
82
82
|
return false;
|