hoffmation-base 3.0.0-alpha.2 → 3.0.0-alpha.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.
- package/lib/models/command/ShutterSetLevelCommand.js +2 -1
- package/lib/models/command/WindowRestoreDesiredPositionCommand.js +1 -0
- package/lib/models/command/WindowSetDesiredPositionCommand.js +1 -0
- package/lib/models/command/WindowSetRolloByWeatherStatusCommand.js +1 -0
- package/lib/models/command/actuatorSetStateCommand.js +3 -2
- package/lib/models/command/actuatorToggleCommand.js +2 -1
- package/lib/models/command/actuatorWriteStateToDeviceCommand.d.ts +1 -1
- package/lib/models/command/actuatorWriteStateToDeviceCommand.js +7 -2
- package/lib/models/command/baseCommand.d.ts +4 -1
- package/lib/models/command/baseCommand.js +25 -6
- package/lib/models/command/blockAutomaticCommand.d.ts +17 -0
- package/lib/models/command/blockAutomaticCommand.js +22 -0
- package/lib/models/command/blockAutomaticLiftBlockCommand.d.ts +12 -0
- package/lib/models/command/blockAutomaticLiftBlockCommand.js +17 -0
- package/lib/models/command/blockAutomaticUntilCommand.d.ts +17 -0
- package/lib/models/command/blockAutomaticUntilCommand.js +22 -0
- package/lib/models/command/commandSource.js +1 -0
- package/lib/models/command/commandType.d.ts +3 -0
- package/lib/models/command/commandType.js +3 -0
- package/lib/models/command/dimmerSetLightCommand.js +6 -5
- package/lib/models/command/index.d.ts +3 -0
- package/lib/models/command/index.js +7 -1
- package/lib/models/command/lampSetLightCommand.js +2 -1
- package/lib/models/command/lampSetTimeBasedCommand.js +1 -1
- package/lib/models/command/lampToggleLightCommand.js +1 -1
- package/lib/models/command/ledSetLightCommand.js +2 -1
- package/lib/models/command/lightGroupSwitchTimeConditionalCommand.js +1 -0
- package/lib/models/command/restoreTargetAutomaticValueCommand.js +2 -1
- package/lib/models/command/roomRestoreLightCommand.js +1 -0
- package/lib/models/command/roomRestoreShutterPositionCommand.js +1 -0
- package/lib/models/command/shutterSunriseUpCommand.js +1 -0
- package/lib/models/command/shutterSunsetDownCommand.js +1 -0
- package/lib/models/command/wledSetLightCommand.d.ts +1 -0
- package/lib/models/command/wledSetLightCommand.js +4 -0
- package/lib/models/deviceSettings/acSettings.d.ts +7 -1
- package/lib/models/deviceSettings/acSettings.js +11 -4
- package/lib/models/deviceSettings/actuatorSettings.d.ts +17 -0
- package/lib/models/deviceSettings/actuatorSettings.js +23 -5
- package/lib/models/deviceSettings/ledSettings.js +10 -18
- package/lib/models/deviceSettings/wledSettings.js +5 -13
- package/lib/models/groupSettings/heatGroupSettings.d.ts +4 -0
- package/lib/models/groupSettings/heatGroupSettings.js +4 -0
- package/lib/models/rooms/RoomBase.js +2 -2
- package/lib/server/devices/IoBrokerBaseDevice.d.ts +2 -0
- package/lib/server/devices/IoBrokerBaseDevice.js +12 -1
- package/lib/server/devices/baseDeviceInterfaces/iAcDevice.d.ts +0 -5
- package/lib/server/devices/groups/heatGroup.d.ts +1 -0
- package/lib/server/devices/groups/heatGroup.js +2 -3
- package/lib/server/devices/groups/lightGroup.d.ts +2 -2
- package/lib/server/devices/groups/lightGroup.js +11 -10
- package/lib/server/devices/hmIPDevices/hmIpLampe.js +1 -2
- package/lib/server/devices/hmIPDevices/hmIpRoll.js +2 -2
- package/lib/server/devices/sharedFunctions/lampUtils.d.ts +1 -0
- package/lib/server/devices/sharedFunctions/lampUtils.js +30 -15
- package/lib/server/devices/wledDevice.d.ts +1 -0
- package/lib/server/devices/wledDevice.js +13 -8
- package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.js +1 -2
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDevice.d.ts +0 -2
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDevice.js +9 -18
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.js +8 -8
- package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.d.ts +2 -1
- package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.js +6 -4
- package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +3 -3
- package/lib/server/services/ac/ac-device.d.ts +0 -5
- package/lib/server/services/ac/ac-device.js +17 -18
- package/lib/server/services/ac/daikin-service.js +2 -1
- package/lib/server/services/ac/own-daikin-device.js +12 -4
- package/lib/server/services/api/api-service.d.ts +65 -2
- package/lib/server/services/api/api-service.js +108 -18
- package/lib/server/services/blockAutomaticHandler.d.ts +6 -8
- package/lib/server/services/blockAutomaticHandler.js +11 -14
- package/lib/server/services/govee/own-govee-device.js +4 -7
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ exports.ShutterSetLevelCommand = void 0;
|
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
6
|
class ShutterSetLevelCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, level, reason = '', skipOpenWarning = false) {
|
|
8
9
|
super(source, reason);
|
|
9
10
|
this.level = level;
|
|
@@ -11,7 +12,7 @@ class ShutterSetLevelCommand extends baseCommand_1.BaseCommand {
|
|
|
11
12
|
this._commandType = commandType_1.CommandType.ShutterSetLevelCommand;
|
|
12
13
|
}
|
|
13
14
|
get logMessage() {
|
|
14
|
-
return `Shutter setLevel to ${this.level}
|
|
15
|
+
return `Shutter setLevel to ${this.level} for reason: ${this.reasonTrace}`;
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
exports.ShutterSetLevelCommand = ShutterSetLevelCommand;
|
|
@@ -4,6 +4,7 @@ exports.WindowRestoreDesiredPositionCommand = void 0;
|
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
6
|
class WindowRestoreDesiredPositionCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, reason = '') {
|
|
8
9
|
super(source, reason);
|
|
9
10
|
this._commandType = commandType_1.CommandType.WindowRestoreDesiredPositionCommand;
|
|
@@ -4,6 +4,7 @@ exports.WindowSetDesiredPositionCommand = void 0;
|
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
6
|
class WindowSetDesiredPositionCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, position, reason = '') {
|
|
8
9
|
super(source, reason);
|
|
9
10
|
this.position = position;
|
|
@@ -4,6 +4,7 @@ exports.WindowSetRolloByWeatherStatusCommand = void 0;
|
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
6
|
class WindowSetRolloByWeatherStatusCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, reason = '') {
|
|
8
9
|
super(source, reason);
|
|
9
10
|
this._commandType = commandType_1.CommandType.WindowSetRolloByWeatherStatusCommand;
|
|
@@ -4,14 +4,15 @@ exports.ActuatorSetStateCommand = void 0;
|
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
6
|
class ActuatorSetStateCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, on, reason = '', timeout = -1) {
|
|
8
9
|
super(source, reason);
|
|
9
10
|
this.on = on;
|
|
10
11
|
this.timeout = timeout;
|
|
11
|
-
this._commandType = commandType_1.CommandType.
|
|
12
|
+
this._commandType = commandType_1.CommandType.ActuatorSetStateCommand;
|
|
12
13
|
}
|
|
13
14
|
get logMessage() {
|
|
14
|
-
return `Actuator setState to ${this.on}
|
|
15
|
+
return `Actuator setState to ${this.on} with timeout ${this.timeout} for reason: ${this.reasonTrace}`;
|
|
15
16
|
}
|
|
16
17
|
static byActuatorAndToggleCommand(device, c) {
|
|
17
18
|
const newVal = device.queuedValue !== null ? !device.queuedValue : !device.actuatorOn;
|
|
@@ -4,12 +4,13 @@ exports.ActuatorToggleCommand = void 0;
|
|
|
4
4
|
const commandType_1 = require("./commandType");
|
|
5
5
|
const baseCommand_1 = require("./baseCommand");
|
|
6
6
|
class ActuatorToggleCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, reason = '') {
|
|
8
9
|
super(source, reason);
|
|
9
10
|
this._commandType = commandType_1.CommandType.ActuatorToggleCommand;
|
|
10
11
|
}
|
|
11
12
|
get logMessage() {
|
|
12
|
-
return `Actuator toggle
|
|
13
|
+
return `Actuator toggle for reason: ${this.reasonTrace}`;
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
exports.ActuatorToggleCommand = ActuatorToggleCommand;
|
|
@@ -4,6 +4,6 @@ import { CommandSource } from './commandSource';
|
|
|
4
4
|
export declare class ActuatorWriteStateToDeviceCommand extends BaseCommand {
|
|
5
5
|
readonly stateValue: boolean;
|
|
6
6
|
_commandType: CommandType;
|
|
7
|
-
constructor(
|
|
7
|
+
constructor(source: CommandSource | BaseCommand, stateValue: boolean, reason?: string);
|
|
8
8
|
get logMessage(): string;
|
|
9
9
|
}
|
|
@@ -3,14 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ActuatorWriteStateToDeviceCommand = void 0;
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
|
+
const actuatorSetStateCommand_1 = require("./actuatorSetStateCommand");
|
|
6
7
|
class ActuatorWriteStateToDeviceCommand extends baseCommand_1.BaseCommand {
|
|
7
|
-
|
|
8
|
+
// TODO: Missing Comment
|
|
9
|
+
constructor(source, stateValue, reason = '') {
|
|
8
10
|
super(source, reason);
|
|
9
11
|
this.stateValue = stateValue;
|
|
10
12
|
this._commandType = commandType_1.CommandType.ActuatorWriteStateToDeviceCommand;
|
|
11
13
|
}
|
|
12
14
|
get logMessage() {
|
|
13
|
-
|
|
15
|
+
if (this.source instanceof actuatorSetStateCommand_1.ActuatorSetStateCommand) {
|
|
16
|
+
return `Actuator Write StateToDevice original Log-message: ${this.source.logMessage}`;
|
|
17
|
+
}
|
|
18
|
+
return `Actuator writeStateToDevice(${this.stateValue}) for reason: ${this.reasonTrace}`;
|
|
14
19
|
}
|
|
15
20
|
}
|
|
16
21
|
exports.ActuatorWriteStateToDeviceCommand = ActuatorWriteStateToDeviceCommand;
|
|
@@ -5,8 +5,11 @@ export declare abstract class BaseCommand {
|
|
|
5
5
|
readonly reason: string;
|
|
6
6
|
readonly timestamp: Date;
|
|
7
7
|
abstract _commandType: CommandType;
|
|
8
|
-
constructor(source?: CommandSource | BaseCommand, reason?: string);
|
|
8
|
+
protected constructor(source?: CommandSource | BaseCommand, reason?: string);
|
|
9
|
+
get isAutomaticAction(): boolean;
|
|
9
10
|
get isForceAction(): boolean;
|
|
11
|
+
get isManual(): boolean;
|
|
10
12
|
get isInitial(): boolean;
|
|
11
13
|
get reasonTrace(): string;
|
|
14
|
+
containsType(type: CommandType): boolean;
|
|
12
15
|
}
|
|
@@ -3,17 +3,30 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BaseCommand = void 0;
|
|
4
4
|
const commandSource_1 = require("./commandSource");
|
|
5
5
|
class BaseCommand {
|
|
6
|
+
// TODO: Missing Comment
|
|
6
7
|
constructor(source = commandSource_1.CommandSource.Unknown, reason = '') {
|
|
7
8
|
this.source = source;
|
|
8
9
|
this.reason = reason;
|
|
9
10
|
this.timestamp = new Date();
|
|
10
11
|
}
|
|
12
|
+
get isAutomaticAction() {
|
|
13
|
+
if (this.source instanceof BaseCommand) {
|
|
14
|
+
return this.source.isAutomaticAction;
|
|
15
|
+
}
|
|
16
|
+
return this.source === commandSource_1.CommandSource.Automatic;
|
|
17
|
+
}
|
|
11
18
|
get isForceAction() {
|
|
12
19
|
if (this.source instanceof BaseCommand) {
|
|
13
20
|
return this.source.isForceAction;
|
|
14
21
|
}
|
|
15
22
|
return (this.source === commandSource_1.CommandSource.Manual || this.source === commandSource_1.CommandSource.API || this.source === commandSource_1.CommandSource.Force);
|
|
16
23
|
}
|
|
24
|
+
get isManual() {
|
|
25
|
+
if (this.source instanceof BaseCommand) {
|
|
26
|
+
return this.source.isManual;
|
|
27
|
+
}
|
|
28
|
+
return this.source === commandSource_1.CommandSource.Manual || this.source === commandSource_1.CommandSource.API;
|
|
29
|
+
}
|
|
17
30
|
get isInitial() {
|
|
18
31
|
if (this.source instanceof BaseCommand) {
|
|
19
32
|
return this.source.isInitial;
|
|
@@ -21,14 +34,20 @@ class BaseCommand {
|
|
|
21
34
|
return this.source === commandSource_1.CommandSource.Initial;
|
|
22
35
|
}
|
|
23
36
|
get reasonTrace() {
|
|
24
|
-
|
|
25
|
-
if (this.source
|
|
26
|
-
|
|
37
|
+
const ownPart = this.reason !== '' ? `${this._commandType}("${this.reason}")` : `${this._commandType}`;
|
|
38
|
+
if (typeof this.source === 'object') {
|
|
39
|
+
return `${this.source.reasonTrace} -> ${ownPart}`;
|
|
27
40
|
}
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
return `CommandType("${commandSource_1.CommandSource[this.source]}") stack => ${ownPart}`;
|
|
42
|
+
}
|
|
43
|
+
containsType(type) {
|
|
44
|
+
if (this._commandType === type) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
if (this.source instanceof BaseCommand) {
|
|
48
|
+
return this.source.containsType(type);
|
|
30
49
|
}
|
|
31
|
-
return
|
|
50
|
+
return false;
|
|
32
51
|
}
|
|
33
52
|
}
|
|
34
53
|
exports.BaseCommand = BaseCommand;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CommandType } from './commandType';
|
|
2
|
+
import { CommandSource } from './commandSource';
|
|
3
|
+
import { CollisionSolving } from '../collisionSolving';
|
|
4
|
+
import { BaseCommand } from './baseCommand';
|
|
5
|
+
export declare class BlockAutomaticCommand extends BaseCommand {
|
|
6
|
+
durationMS: number;
|
|
7
|
+
onCollideAction: CollisionSolving;
|
|
8
|
+
_commandType: CommandType;
|
|
9
|
+
/**
|
|
10
|
+
* Command to disable automatic actions for a specific duration.
|
|
11
|
+
* @param {CommandSource} source The source of the command.
|
|
12
|
+
* @param {number} durationMS The duration in milliseconds for the automatic actions to be disabled.
|
|
13
|
+
* @param reason You can provide an individual reason here for debugging purpose.
|
|
14
|
+
* @param {CollisionSolving} onCollideAction The action to take if a block is already active. --> Default: overrideIfGreater
|
|
15
|
+
*/
|
|
16
|
+
constructor(source: CommandSource | BaseCommand, durationMS: number, reason?: string, onCollideAction?: CollisionSolving);
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlockAutomaticCommand = void 0;
|
|
4
|
+
const commandType_1 = require("./commandType");
|
|
5
|
+
const collisionSolving_1 = require("../collisionSolving");
|
|
6
|
+
const baseCommand_1 = require("./baseCommand");
|
|
7
|
+
class BlockAutomaticCommand extends baseCommand_1.BaseCommand {
|
|
8
|
+
/**
|
|
9
|
+
* Command to disable automatic actions for a specific duration.
|
|
10
|
+
* @param {CommandSource} source The source of the command.
|
|
11
|
+
* @param {number} durationMS The duration in milliseconds for the automatic actions to be disabled.
|
|
12
|
+
* @param reason You can provide an individual reason here for debugging purpose.
|
|
13
|
+
* @param {CollisionSolving} onCollideAction The action to take if a block is already active. --> Default: overrideIfGreater
|
|
14
|
+
*/
|
|
15
|
+
constructor(source, durationMS, reason = '', onCollideAction = collisionSolving_1.CollisionSolving.overrideIfGreater) {
|
|
16
|
+
super(source, reason);
|
|
17
|
+
this.durationMS = durationMS;
|
|
18
|
+
this.onCollideAction = onCollideAction;
|
|
19
|
+
this._commandType = commandType_1.CommandType.BlockAutomaticCommand;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.BlockAutomaticCommand = BlockAutomaticCommand;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CommandType } from './commandType';
|
|
2
|
+
import { CommandSource } from './commandSource';
|
|
3
|
+
import { BaseCommand } from './baseCommand';
|
|
4
|
+
export declare class BlockAutomaticLiftBlockCommand extends BaseCommand {
|
|
5
|
+
_commandType: CommandType;
|
|
6
|
+
/**
|
|
7
|
+
* Command to lift a block --> Restore the automatic actions.
|
|
8
|
+
* @param {CommandSource | BaseCommand} source The source of the command.
|
|
9
|
+
* @param {string} reason You can provide an individual reason here for debugging purpose.
|
|
10
|
+
*/
|
|
11
|
+
constructor(source: CommandSource | BaseCommand, reason?: string);
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlockAutomaticLiftBlockCommand = void 0;
|
|
4
|
+
const commandType_1 = require("./commandType");
|
|
5
|
+
const baseCommand_1 = require("./baseCommand");
|
|
6
|
+
class BlockAutomaticLiftBlockCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
/**
|
|
8
|
+
* Command to lift a block --> Restore the automatic actions.
|
|
9
|
+
* @param {CommandSource | BaseCommand} source The source of the command.
|
|
10
|
+
* @param {string} reason You can provide an individual reason here for debugging purpose.
|
|
11
|
+
*/
|
|
12
|
+
constructor(source, reason = '') {
|
|
13
|
+
super(source, reason);
|
|
14
|
+
this._commandType = commandType_1.CommandType.BlockAutomaticLiftBlockCommand;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.BlockAutomaticLiftBlockCommand = BlockAutomaticLiftBlockCommand;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CommandType } from './commandType';
|
|
2
|
+
import { CommandSource } from './commandSource';
|
|
3
|
+
import { CollisionSolving } from '../collisionSolving';
|
|
4
|
+
import { BaseCommand } from './baseCommand';
|
|
5
|
+
export declare class BlockAutomaticUntilCommand extends BaseCommand {
|
|
6
|
+
targetDate: Date;
|
|
7
|
+
onCollideAction: CollisionSolving;
|
|
8
|
+
_commandType: CommandType;
|
|
9
|
+
/**
|
|
10
|
+
* Command to disable automatic actions until a specific date.
|
|
11
|
+
* @param {CommandSource} source The source of the command.
|
|
12
|
+
* @param {Date} targetDate The date until the automatic actions will be disabled.
|
|
13
|
+
* @param reason You can provide an individual reason here for debugging purpose.
|
|
14
|
+
* @param {CollisionSolving} onCollideAction The action to take if a block is already active. --> Default: overrideIfGreater
|
|
15
|
+
*/
|
|
16
|
+
constructor(source: CommandSource | BaseCommand, targetDate: Date, reason?: string, onCollideAction?: CollisionSolving);
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlockAutomaticUntilCommand = void 0;
|
|
4
|
+
const commandType_1 = require("./commandType");
|
|
5
|
+
const collisionSolving_1 = require("../collisionSolving");
|
|
6
|
+
const baseCommand_1 = require("./baseCommand");
|
|
7
|
+
class BlockAutomaticUntilCommand extends baseCommand_1.BaseCommand {
|
|
8
|
+
/**
|
|
9
|
+
* Command to disable automatic actions until a specific date.
|
|
10
|
+
* @param {CommandSource} source The source of the command.
|
|
11
|
+
* @param {Date} targetDate The date until the automatic actions will be disabled.
|
|
12
|
+
* @param reason You can provide an individual reason here for debugging purpose.
|
|
13
|
+
* @param {CollisionSolving} onCollideAction The action to take if a block is already active. --> Default: overrideIfGreater
|
|
14
|
+
*/
|
|
15
|
+
constructor(source, targetDate, reason = '', onCollideAction = collisionSolving_1.CollisionSolving.overrideIfGreater) {
|
|
16
|
+
super(source, reason);
|
|
17
|
+
this.targetDate = targetDate;
|
|
18
|
+
this.onCollideAction = onCollideAction;
|
|
19
|
+
this._commandType = commandType_1.CommandType.BlockAutomaticUntilCommand;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.BlockAutomaticUntilCommand = BlockAutomaticUntilCommand;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare enum CommandType {
|
|
2
|
+
BlockAutomaticLiftBlockCommand = "BlockAutomaticLiftBlockCommand",
|
|
3
|
+
BlockAutomaticCommand = "BlockAutomaticCommand",
|
|
4
|
+
BlockAutomaticUntilCommand = "BlockAutomaticUntilCommand",
|
|
2
5
|
ActuatorToggleCommand = "ActuatorToggleCommand",
|
|
3
6
|
ActuatorSetStateCommand = "ActuatorSetStateCommand",
|
|
4
7
|
ActuatorRestoreTargetAutomaticValueCommand = "ActuatorRestoreTargetAutomaticValueCommand",
|
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CommandType = void 0;
|
|
4
4
|
var CommandType;
|
|
5
5
|
(function (CommandType) {
|
|
6
|
+
CommandType["BlockAutomaticLiftBlockCommand"] = "BlockAutomaticLiftBlockCommand";
|
|
7
|
+
CommandType["BlockAutomaticCommand"] = "BlockAutomaticCommand";
|
|
8
|
+
CommandType["BlockAutomaticUntilCommand"] = "BlockAutomaticUntilCommand";
|
|
6
9
|
CommandType["ActuatorToggleCommand"] = "ActuatorToggleCommand";
|
|
7
10
|
CommandType["ActuatorSetStateCommand"] = "ActuatorSetStateCommand";
|
|
8
11
|
CommandType["ActuatorRestoreTargetAutomaticValueCommand"] = "ActuatorRestoreTargetAutomaticValueCommand";
|
|
@@ -20,18 +20,19 @@ class DimmerSetLightCommand extends lampSetLightCommand_1.LampSetLightCommand {
|
|
|
20
20
|
this._commandType = commandType_1.CommandType.DimmerSetLightCommand;
|
|
21
21
|
}
|
|
22
22
|
get logMessage() {
|
|
23
|
-
return `Dimmer setLight to ${this.on}
|
|
23
|
+
return `Dimmer setLight to ${this.on} with Brightness ${this.brightness} with timeout ${this.timeout} for reason: ${this.reasonTrace}`;
|
|
24
24
|
}
|
|
25
25
|
static byTimeBased(s, c) {
|
|
26
|
+
const manual = c.isForceAction;
|
|
26
27
|
switch (c.time) {
|
|
27
28
|
case timeCallback_1.TimeOfDay.Daylight:
|
|
28
|
-
return new DimmerSetLightCommand(c,
|
|
29
|
+
return new DimmerSetLightCommand(c, manual || s.dayOn, 'Daylight', c.timeout, s.dayBrightness);
|
|
29
30
|
case timeCallback_1.TimeOfDay.BeforeSunrise:
|
|
30
|
-
return new DimmerSetLightCommand(c, s.dawnOn, '', c.timeout, s.dawnBrightness, undefined);
|
|
31
|
+
return new DimmerSetLightCommand(c, manual || s.dawnOn, 'Dawn', c.timeout, s.dawnBrightness, undefined);
|
|
31
32
|
case timeCallback_1.TimeOfDay.AfterSunset:
|
|
32
|
-
return new DimmerSetLightCommand(c, s.duskOn, '', c.timeout, s.duskBrightness, undefined);
|
|
33
|
+
return new DimmerSetLightCommand(c, manual || s.duskOn, 'Dusk', c.timeout, s.duskBrightness, undefined);
|
|
33
34
|
case timeCallback_1.TimeOfDay.Night:
|
|
34
|
-
return new DimmerSetLightCommand(c, s.nightOn, '', c.timeout, s.nightBrightness, undefined);
|
|
35
|
+
return new DimmerSetLightCommand(c, manual || s.nightOn, 'Night', c.timeout, s.nightBrightness, undefined);
|
|
35
36
|
default:
|
|
36
37
|
throw new Error(`TimeOfDay ${c.time} not supported`);
|
|
37
38
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { BlockAutomaticCommand } from './blockAutomaticCommand';
|
|
2
|
+
export { BlockAutomaticUntilCommand } from './blockAutomaticUntilCommand';
|
|
3
|
+
export { BlockAutomaticLiftBlockCommand } from './blockAutomaticLiftBlockCommand';
|
|
1
4
|
export { RestoreTargetAutomaticValueCommand } from './restoreTargetAutomaticValueCommand';
|
|
2
5
|
export { ActuatorSetStateCommand } from './actuatorSetStateCommand';
|
|
3
6
|
export { ActuatorToggleCommand } from './actuatorToggleCommand';
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WledSetLightCommand = exports.WindowSetRolloByWeatherStatusCommand = exports.WindowSetDesiredPositionCommand = exports.WindowRestoreDesiredPositionCommand = exports.ShutterSunsetDownCommand = exports.ShutterSunriseUpCommand = exports.ShutterSetLevelCommand = exports.RoomSetLightTimeBasedCommand = exports.RoomRestoreShutterPositionCommand = exports.RoomRestoreLightCommand = exports.LightGroupSwitchTimeConditionalCommand = exports.LedSetLightCommand = exports.LampToggleLightCommand = exports.LampSetTimeBasedCommand = exports.LampSetLightCommand = exports.FloorSetAllShuttersCommand = exports.DimmerSetLightCommand = exports.CommandType = exports.CommandSource = exports.BaseCommand = exports.ActuatorWriteStateToDeviceCommand = exports.ActuatorToggleCommand = exports.ActuatorSetStateCommand = exports.RestoreTargetAutomaticValueCommand = void 0;
|
|
3
|
+
exports.WledSetLightCommand = exports.WindowSetRolloByWeatherStatusCommand = exports.WindowSetDesiredPositionCommand = exports.WindowRestoreDesiredPositionCommand = exports.ShutterSunsetDownCommand = exports.ShutterSunriseUpCommand = exports.ShutterSetLevelCommand = exports.RoomSetLightTimeBasedCommand = exports.RoomRestoreShutterPositionCommand = exports.RoomRestoreLightCommand = exports.LightGroupSwitchTimeConditionalCommand = exports.LedSetLightCommand = exports.LampToggleLightCommand = exports.LampSetTimeBasedCommand = exports.LampSetLightCommand = exports.FloorSetAllShuttersCommand = exports.DimmerSetLightCommand = exports.CommandType = exports.CommandSource = exports.BaseCommand = exports.ActuatorWriteStateToDeviceCommand = exports.ActuatorToggleCommand = exports.ActuatorSetStateCommand = exports.RestoreTargetAutomaticValueCommand = exports.BlockAutomaticLiftBlockCommand = exports.BlockAutomaticUntilCommand = exports.BlockAutomaticCommand = void 0;
|
|
4
|
+
var blockAutomaticCommand_1 = require("./blockAutomaticCommand");
|
|
5
|
+
Object.defineProperty(exports, "BlockAutomaticCommand", { enumerable: true, get: function () { return blockAutomaticCommand_1.BlockAutomaticCommand; } });
|
|
6
|
+
var blockAutomaticUntilCommand_1 = require("./blockAutomaticUntilCommand");
|
|
7
|
+
Object.defineProperty(exports, "BlockAutomaticUntilCommand", { enumerable: true, get: function () { return blockAutomaticUntilCommand_1.BlockAutomaticUntilCommand; } });
|
|
8
|
+
var blockAutomaticLiftBlockCommand_1 = require("./blockAutomaticLiftBlockCommand");
|
|
9
|
+
Object.defineProperty(exports, "BlockAutomaticLiftBlockCommand", { enumerable: true, get: function () { return blockAutomaticLiftBlockCommand_1.BlockAutomaticLiftBlockCommand; } });
|
|
4
10
|
var restoreTargetAutomaticValueCommand_1 = require("./restoreTargetAutomaticValueCommand");
|
|
5
11
|
Object.defineProperty(exports, "RestoreTargetAutomaticValueCommand", { enumerable: true, get: function () { return restoreTargetAutomaticValueCommand_1.RestoreTargetAutomaticValueCommand; } });
|
|
6
12
|
var actuatorSetStateCommand_1 = require("./actuatorSetStateCommand");
|
|
@@ -4,12 +4,13 @@ exports.LampSetLightCommand = void 0;
|
|
|
4
4
|
const commandType_1 = require("./commandType");
|
|
5
5
|
const actuatorSetStateCommand_1 = require("./actuatorSetStateCommand");
|
|
6
6
|
class LampSetLightCommand extends actuatorSetStateCommand_1.ActuatorSetStateCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, on, reason = '', timeout = -1) {
|
|
8
9
|
super(source, on, reason, timeout);
|
|
9
10
|
this._commandType = commandType_1.CommandType.LampSetLightCommand;
|
|
10
11
|
}
|
|
11
12
|
get logMessage() {
|
|
12
|
-
return `Lamp setLight to ${this.on}
|
|
13
|
+
return `Lamp setLight to ${this.on} with timeout ${this.timeout} for reason: ${this.reasonTrace}`;
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
exports.LampSetLightCommand = LampSetLightCommand;
|
|
@@ -19,7 +19,7 @@ class LampSetTimeBasedCommand extends baseCommand_1.BaseCommand {
|
|
|
19
19
|
this._commandType = commandType_1.CommandType.LampSetTimeBasedCommand;
|
|
20
20
|
}
|
|
21
21
|
get logMessage() {
|
|
22
|
-
return `Lamp setTimeBased to ${timeCallback_1.TimeOfDay[this.time]}
|
|
22
|
+
return `Lamp setTimeBased to ${timeCallback_1.TimeOfDay[this.time]} for reason: ${this.reasonTrace}`;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
exports.LampSetTimeBasedCommand = LampSetTimeBasedCommand;
|
|
@@ -18,7 +18,7 @@ class LampToggleLightCommand extends actuatorToggleCommand_1.ActuatorToggleComma
|
|
|
18
18
|
this._commandType = commandType_1.CommandType.LampToggleLightCommand;
|
|
19
19
|
}
|
|
20
20
|
get logMessage() {
|
|
21
|
-
return `Lamp toggleLight
|
|
21
|
+
return `Lamp toggleLight for reason: ${this.reasonTrace}`;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
exports.LampToggleLightCommand = LampToggleLightCommand;
|
|
@@ -23,8 +23,9 @@ class LedSetLightCommand extends dimmerSetLightCommand_1.DimmerSetLightCommand {
|
|
|
23
23
|
this._commandType = commandType_1.CommandType.LedSetLightCommand;
|
|
24
24
|
}
|
|
25
25
|
get logMessage() {
|
|
26
|
-
return `Led setLight to ${this.on}
|
|
26
|
+
return `Led setLight to state: ${this.on}, timeout: ${this.timeout}, brightness: ${this.brightness}, color: ${this.color}, colorTemp: ${this.colorTemp} for reason: ${this.reasonTrace}`;
|
|
27
27
|
}
|
|
28
|
+
// TODO: Missing Comment
|
|
28
29
|
static byTimeBased(settings, c) {
|
|
29
30
|
switch (c.time) {
|
|
30
31
|
case timeCallback_1.TimeOfDay.Daylight:
|
|
@@ -4,6 +4,7 @@ exports.LightGroupSwitchTimeConditionalCommand = void 0;
|
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
6
|
class LightGroupSwitchTimeConditionalCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, time, reason = '') {
|
|
8
9
|
super(source, reason);
|
|
9
10
|
this.time = time;
|
|
@@ -4,12 +4,13 @@ exports.RestoreTargetAutomaticValueCommand = void 0;
|
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
6
|
class RestoreTargetAutomaticValueCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, reason = '') {
|
|
8
9
|
super(source, reason);
|
|
9
10
|
this._commandType = commandType_1.CommandType.ActuatorRestoreTargetAutomaticValueCommand;
|
|
10
11
|
}
|
|
11
12
|
get logMessage() {
|
|
12
|
-
return `Actuator restore target automatic value
|
|
13
|
+
return `Actuator restore target automatic value due to reason: ${this.reasonTrace}`;
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
exports.RestoreTargetAutomaticValueCommand = RestoreTargetAutomaticValueCommand;
|
|
@@ -4,6 +4,7 @@ exports.RoomRestoreLightCommand = void 0;
|
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
6
|
class RoomRestoreLightCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, reason = '') {
|
|
8
9
|
super(source, reason);
|
|
9
10
|
this._commandType = commandType_1.CommandType.RoomRestoreLightCommand;
|
|
@@ -4,6 +4,7 @@ exports.RoomRestoreShutterPositionCommand = void 0;
|
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
6
|
class RoomRestoreShutterPositionCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, recalc = false, reason = '') {
|
|
8
9
|
super(source, reason);
|
|
9
10
|
this.recalc = recalc;
|
|
@@ -4,6 +4,7 @@ exports.ShutterSunriseUpCommand = void 0;
|
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
6
|
class ShutterSunriseUpCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, reason = '') {
|
|
8
9
|
super(source, reason);
|
|
9
10
|
this._commandType = commandType_1.CommandType.ShutterSunriseUpCommand;
|
|
@@ -4,6 +4,7 @@ exports.ShutterSunsetDownCommand = void 0;
|
|
|
4
4
|
const baseCommand_1 = require("./baseCommand");
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
6
|
class ShutterSunsetDownCommand extends baseCommand_1.BaseCommand {
|
|
7
|
+
// TODO: Missing Comment
|
|
7
8
|
constructor(source, reason = '') {
|
|
8
9
|
super(source, reason);
|
|
9
10
|
this._commandType = commandType_1.CommandType.SunsetDownCommand;
|
|
@@ -8,5 +8,6 @@ export declare class WledSetLightCommand extends DimmerSetLightCommand {
|
|
|
8
8
|
preset?: number | undefined;
|
|
9
9
|
_commandType: CommandType;
|
|
10
10
|
constructor(source: CommandSource | BaseCommand, on: boolean, reason?: string, timeout?: number, brightness?: number, transitionTime?: number, preset?: number | undefined);
|
|
11
|
+
get logMessage(): string;
|
|
11
12
|
static byTimeBased(settings: WledSettings, c: LampSetTimeBasedCommand): WledSetLightCommand;
|
|
12
13
|
}
|
|
@@ -5,11 +5,15 @@ const commandType_1 = require("./commandType");
|
|
|
5
5
|
const dimmerSetLightCommand_1 = require("./dimmerSetLightCommand");
|
|
6
6
|
const timeCallback_1 = require("../timeCallback");
|
|
7
7
|
class WledSetLightCommand extends dimmerSetLightCommand_1.DimmerSetLightCommand {
|
|
8
|
+
// TODO: Missing Comment
|
|
8
9
|
constructor(source, on, reason = '', timeout = -1, brightness = -1, transitionTime = -1, preset) {
|
|
9
10
|
super(source, on, reason, timeout, brightness, transitionTime);
|
|
10
11
|
this.preset = preset;
|
|
11
12
|
this._commandType = commandType_1.CommandType.WledSetLightCommand;
|
|
12
13
|
}
|
|
14
|
+
get logMessage() {
|
|
15
|
+
return `Dimmer setLight to ${this.on} with Brightness ${this.brightness}, timeout ${this.timeout} and preset ${this.preset} for reason: ${this.reasonTrace}`;
|
|
16
|
+
}
|
|
13
17
|
static byTimeBased(settings, c) {
|
|
14
18
|
switch (c.time) {
|
|
15
19
|
case timeCallback_1.TimeOfDay.Daylight:
|
|
@@ -15,7 +15,13 @@ export declare class AcSettings extends DeviceSettings {
|
|
|
15
15
|
* Whether we should ignore the room temperature and let the AC decide on its own
|
|
16
16
|
* @type {boolean}
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
useOwnTemperature: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the AC should use automatic mode to decide on its own whether to heat or cool
|
|
21
|
+
* !!Warning!! This can result in excessive energy consumption, as overshooting the temperature can result in the AC switching to the opposite mode
|
|
22
|
+
* @type {boolean}
|
|
23
|
+
*/
|
|
24
|
+
useAutomatic: boolean;
|
|
19
25
|
/**
|
|
20
26
|
* Whether we should turn off AC-Cooling when someone is in the room
|
|
21
27
|
* @type {boolean}
|
|
@@ -21,7 +21,13 @@ class AcSettings extends deviceSettings_1.DeviceSettings {
|
|
|
21
21
|
* Whether we should ignore the room temperature and let the AC decide on its own
|
|
22
22
|
* @type {boolean}
|
|
23
23
|
*/
|
|
24
|
-
this.
|
|
24
|
+
this.useOwnTemperature = false;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the AC should use automatic mode to decide on its own whether to heat or cool
|
|
27
|
+
* !!Warning!! This can result in excessive energy consumption, as overshooting the temperature can result in the AC switching to the opposite mode
|
|
28
|
+
* @type {boolean}
|
|
29
|
+
*/
|
|
30
|
+
this.useAutomatic = false;
|
|
25
31
|
/**
|
|
26
32
|
* Whether we should turn off AC-Cooling when someone is in the room
|
|
27
33
|
* @type {boolean}
|
|
@@ -34,15 +40,16 @@ class AcSettings extends deviceSettings_1.DeviceSettings {
|
|
|
34
40
|
this.manualDisabled = false;
|
|
35
41
|
}
|
|
36
42
|
fromPartialObject(data) {
|
|
37
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
43
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
38
44
|
this.minimumHours = (_a = data.minimumHours) !== null && _a !== void 0 ? _a : this.minimumHours;
|
|
39
45
|
this.minimumMinutes = (_b = data.minimumMinutes) !== null && _b !== void 0 ? _b : this.minimumMinutes;
|
|
40
46
|
this.maximumHours = (_c = data.maximumHours) !== null && _c !== void 0 ? _c : this.maximumHours;
|
|
41
47
|
this.maximumMinutes = (_d = data.maximumMinutes) !== null && _d !== void 0 ? _d : this.maximumMinutes;
|
|
42
48
|
this.heatingAllowed = (_e = data.heatingAllowed) !== null && _e !== void 0 ? _e : this.heatingAllowed;
|
|
43
49
|
this.noCoolingOnMovement = (_f = data.noCoolingOnMovement) !== null && _f !== void 0 ? _f : this.noCoolingOnMovement;
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
50
|
+
this.useOwnTemperature = (_g = data.useOwnTemperature) !== null && _g !== void 0 ? _g : this.useOwnTemperature;
|
|
51
|
+
this.useAutomatic = (_h = data.useAutomatic) !== null && _h !== void 0 ? _h : this.useAutomatic;
|
|
52
|
+
this.manualDisabled = (_j = data.manualDisabled) !== null && _j !== void 0 ? _j : this.manualDisabled;
|
|
46
53
|
super.fromPartialObject(data);
|
|
47
54
|
}
|
|
48
55
|
toJSON() {
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import { DeviceSettings } from './deviceSettings';
|
|
2
2
|
export declare class ActuatorSettings extends DeviceSettings {
|
|
3
|
+
/**
|
|
4
|
+
* Whether to turn on the device at dawn in time-based commands or automatic.
|
|
5
|
+
* @type {boolean}
|
|
6
|
+
*/
|
|
3
7
|
dawnOn: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Whether to turn on the device at dusk in time-based commands or automatic.
|
|
10
|
+
* @type {boolean}
|
|
11
|
+
*/
|
|
4
12
|
duskOn: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Whether to turn on the device at night in time-based commands or automatic.
|
|
15
|
+
* @type {boolean}
|
|
16
|
+
*/
|
|
5
17
|
nightOn: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to turn on the device at day in time-based commands or automatic.
|
|
20
|
+
* @type {boolean}
|
|
21
|
+
*/
|
|
22
|
+
dayOn: boolean;
|
|
6
23
|
/**
|
|
7
24
|
* Indicates if this device controls e.g. an Eltako, which has it's own Turn Off Time logic.
|
|
8
25
|
* @type {boolean}
|