hoffmation-base 3.0.0-alpha.19 → 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 +1 -0
- 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 +1 -0
- package/lib/models/command/actuatorToggleCommand.js +1 -0
- package/lib/models/command/actuatorWriteStateToDeviceCommand.js +1 -0
- package/lib/models/command/baseCommand.d.ts +1 -1
- package/lib/models/command/baseCommand.js +1 -0
- 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/index.d.ts +3 -0
- package/lib/models/command/index.js +7 -1
- package/lib/models/command/lampSetLightCommand.js +1 -0
- package/lib/models/command/ledSetLightCommand.js +1 -0
- package/lib/models/command/lightGroupSwitchTimeConditionalCommand.js +1 -0
- package/lib/models/command/restoreTargetAutomaticValueCommand.js +1 -0
- 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.js +1 -0
- 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/sharedFunctions/lampUtils.js +2 -3
- package/lib/server/devices/wledDevice.js +1 -1
- package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.js +1 -1
- package/lib/server/services/ac/ac-device.d.ts +0 -5
- package/lib/server/services/ac/ac-device.js +2 -8
- package/lib/server/services/ac/daikin-service.js +2 -1
- 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 -9
- package/lib/server/services/blockAutomaticHandler.js +11 -29
- package/lib/server/services/govee/own-govee-device.js +1 -1
- 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;
|
|
@@ -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,6 +4,7 @@ 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;
|
|
@@ -4,6 +4,7 @@ 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;
|
|
@@ -5,6 +5,7 @@ const baseCommand_1 = require("./baseCommand");
|
|
|
5
5
|
const commandType_1 = require("./commandType");
|
|
6
6
|
const actuatorSetStateCommand_1 = require("./actuatorSetStateCommand");
|
|
7
7
|
class ActuatorWriteStateToDeviceCommand extends baseCommand_1.BaseCommand {
|
|
8
|
+
// TODO: Missing Comment
|
|
8
9
|
constructor(source, stateValue, reason = '') {
|
|
9
10
|
super(source, reason);
|
|
10
11
|
this.stateValue = stateValue;
|
|
@@ -5,7 +5,7 @@ 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
9
|
get isAutomaticAction(): boolean;
|
|
10
10
|
get isForceAction(): boolean;
|
|
11
11
|
get isManual(): boolean;
|
|
@@ -3,6 +3,7 @@ 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;
|
|
@@ -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";
|
|
@@ -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,6 +4,7 @@ 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;
|
|
@@ -25,6 +25,7 @@ class LedSetLightCommand extends dimmerSetLightCommand_1.DimmerSetLightCommand {
|
|
|
25
25
|
get logMessage() {
|
|
26
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,6 +4,7 @@ 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;
|
|
@@ -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;
|
|
@@ -5,6 +5,7 @@ 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;
|
|
@@ -6,11 +6,6 @@ export interface iAcDevice extends iBaseDevice {
|
|
|
6
6
|
readonly on: boolean;
|
|
7
7
|
readonly temperature: number;
|
|
8
8
|
readonly mode: AcMode;
|
|
9
|
-
/**
|
|
10
|
-
* Disable automatic Turn-On for given amount of ms and turn off immediately.
|
|
11
|
-
* @param {number} timeout
|
|
12
|
-
*/
|
|
13
|
-
deactivateAutomaticChange(timeout: number): void;
|
|
14
9
|
onTemperaturChange(newTemperatur: number): void;
|
|
15
10
|
setDesiredMode(mode: AcMode, writeToDevice: boolean): void;
|
|
16
11
|
turnOn(): void;
|
|
@@ -25,6 +25,7 @@ export declare class HeatGroup extends BaseGroup {
|
|
|
25
25
|
initialize(): void;
|
|
26
26
|
/**
|
|
27
27
|
* Sets all ACs to new desired Value
|
|
28
|
+
* TODO: Migrate to new Command System
|
|
28
29
|
* @param {boolean} newDesiredState
|
|
29
30
|
* @param {boolean} force Whether this was a manual trigger, thus blocking automatic changes for 1 hour
|
|
30
31
|
*/
|
|
@@ -127,6 +127,7 @@ class HeatGroup extends base_group_1.BaseGroup {
|
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
129
|
* Sets all ACs to new desired Value
|
|
130
|
+
* TODO: Migrate to new Command System
|
|
130
131
|
* @param {boolean} newDesiredState
|
|
131
132
|
* @param {boolean} force Whether this was a manual trigger, thus blocking automatic changes for 1 hour
|
|
132
133
|
*/
|
|
@@ -139,9 +140,7 @@ class HeatGroup extends base_group_1.BaseGroup {
|
|
|
139
140
|
continue;
|
|
140
141
|
}
|
|
141
142
|
dev.turnOff();
|
|
142
|
-
|
|
143
|
-
dev.deactivateAutomaticChange(60 * 60 * 1000);
|
|
144
|
-
}
|
|
143
|
+
dev.blockAutomationHandler.disableAutomatic(new models_1.BlockAutomaticCommand(force ? models_1.CommandSource.Force : models_1.CommandSource.Unknown, 60 * 60 * 1000));
|
|
145
144
|
}
|
|
146
145
|
}
|
|
147
146
|
deleteAutomaticPoint(name) {
|
|
@@ -34,8 +34,7 @@ class LampUtils {
|
|
|
34
34
|
!command.on &&
|
|
35
35
|
device.blockAutomationHandler.automaticBlockActive) {
|
|
36
36
|
dontBlock = true;
|
|
37
|
-
device.
|
|
38
|
-
device.blockAutomationHandler.liftAutomaticBlock();
|
|
37
|
+
device.blockAutomationHandler.liftAutomaticBlock(new models_1.BlockAutomaticLiftBlockCommand(command, 'Reset Automatic Block as we are turning off manually after a force on'));
|
|
39
38
|
}
|
|
40
39
|
return dontBlock;
|
|
41
40
|
}
|
|
@@ -93,7 +92,7 @@ class LampUtils {
|
|
|
93
92
|
LampUtils.stromStossOn(device);
|
|
94
93
|
}
|
|
95
94
|
if (c.timeout > -1 && !dontBlock) {
|
|
96
|
-
device.blockAutomationHandler.disableAutomatic(c.timeout, models_1.CollisionSolving.overrideIfGreater);
|
|
95
|
+
device.blockAutomationHandler.disableAutomatic(new models_1.BlockAutomaticCommand(c, c.timeout, '', models_1.CollisionSolving.overrideIfGreater));
|
|
97
96
|
}
|
|
98
97
|
}
|
|
99
98
|
}
|
|
@@ -83,7 +83,7 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
|
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
if (c.timeout !== undefined && c.timeout > -1 && !dontBlock) {
|
|
86
|
-
this.blockAutomationHandler.disableAutomatic(c.timeout, models_1.CollisionSolving.overrideIfGreater);
|
|
86
|
+
this.blockAutomationHandler.disableAutomatic(new models_1.BlockAutomaticCommand(c, c.timeout, '', models_1.CollisionSolving.overrideIfGreater));
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
setTimeBased(c) {
|
|
@@ -93,7 +93,7 @@ class ZigbeeDimmer extends index_1.ZigbeeDevice {
|
|
|
93
93
|
c.brightness = 10;
|
|
94
94
|
}
|
|
95
95
|
if (c.timeout > -1 && !dontBlock) {
|
|
96
|
-
this.blockAutomationHandler.disableAutomatic(c
|
|
96
|
+
this.blockAutomationHandler.disableAutomatic(new models_1.BlockAutomaticCommand(c, c.timeout));
|
|
97
97
|
}
|
|
98
98
|
if (((_a = services_1.SettingsService.settings.ioBroker) === null || _a === void 0 ? void 0 : _a.useZigbee2mqtt) && !c.on) {
|
|
99
99
|
// With zigbee2mqtt to turn on only setting brighness>0 is needed, so we need state only for turning off
|
|
@@ -37,11 +37,6 @@ export declare abstract class AcDevice implements iExcessEnergyConsumer, iRoomDe
|
|
|
37
37
|
restoreTargetAutomaticValue(): void;
|
|
38
38
|
isAvailableForExcessEnergy(): boolean;
|
|
39
39
|
calculateDesiredMode(): AcMode;
|
|
40
|
-
/**
|
|
41
|
-
* Disable automatic Turn-On and Turn-Off for given amount of ms.
|
|
42
|
-
* @param {number} timeout
|
|
43
|
-
*/
|
|
44
|
-
deactivateAutomaticChange(timeout?: number): void;
|
|
45
40
|
abstract setDesiredMode(mode: AcMode, writeToDevice: boolean, temp?: number): void;
|
|
46
41
|
abstract turnOn(): void;
|
|
47
42
|
onTemperaturChange(newTemperatur: number): void;
|
|
@@ -163,13 +163,6 @@ class AcDevice {
|
|
|
163
163
|
}
|
|
164
164
|
return desiredMode;
|
|
165
165
|
}
|
|
166
|
-
/**
|
|
167
|
-
* Disable automatic Turn-On and Turn-Off for given amount of ms.
|
|
168
|
-
* @param {number} timeout
|
|
169
|
-
*/
|
|
170
|
-
deactivateAutomaticChange(timeout = 60 * 60 * 1000) {
|
|
171
|
-
this.blockAutomationHandler.disableAutomatic(timeout);
|
|
172
|
-
}
|
|
173
166
|
onTemperaturChange(newTemperatur) {
|
|
174
167
|
this.roomTemperatur = newTemperatur;
|
|
175
168
|
}
|
|
@@ -191,8 +184,9 @@ class AcDevice {
|
|
|
191
184
|
turnOffDueToMissingEnergy() {
|
|
192
185
|
this.turnOff();
|
|
193
186
|
}
|
|
187
|
+
// TODO: Migrate to new command system
|
|
194
188
|
setState(mode, desiredTemp, forceTime = 60 * 60 * 1000) {
|
|
195
|
-
this.blockAutomationHandler.disableAutomatic(forceTime);
|
|
189
|
+
this.blockAutomationHandler.disableAutomatic(new models_1.BlockAutomaticCommand(models_1.CommandSource.Unknown, forceTime));
|
|
196
190
|
this._mode = mode;
|
|
197
191
|
if (mode == ac_mode_1.AcMode.Off) {
|
|
198
192
|
this.turnOff();
|
|
@@ -68,6 +68,7 @@ class DaikinService {
|
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
+
// TODO: Migrate to new command system
|
|
71
72
|
static setAll(on, force = false) {
|
|
72
73
|
if (!this.isInitialized) {
|
|
73
74
|
return;
|
|
@@ -81,7 +82,7 @@ class DaikinService {
|
|
|
81
82
|
dev.turnOff();
|
|
82
83
|
}
|
|
83
84
|
if (force) {
|
|
84
|
-
dev.
|
|
85
|
+
dev.blockAutomationHandler.disableAutomatic(new models_1.BlockAutomaticCommand(models_1.CommandSource.Unknown, 180 * 60 * 1000));
|
|
85
86
|
}
|
|
86
87
|
}
|
|
87
88
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseGroup, ButtonPosition, ButtonPressType, iBaseDevice } from '../../devices';
|
|
2
|
-
import { CollisionSolving, DeviceSettings, RoomBase } from '../../../models';
|
|
2
|
+
import { ActuatorSetStateCommand, BlockAutomaticCommand, BlockAutomaticLiftBlockCommand, CollisionSolving, DeviceSettings, DimmerSetLightCommand, LampSetLightCommand, LedSetLightCommand, RoomBase, ShutterSetLevelCommand } from '../../../models';
|
|
3
3
|
import { LogObject } from '../log-service';
|
|
4
4
|
import { AcDevice, AcMode } from '../ac';
|
|
5
5
|
import { GroupSettings } from '../../../models/groupSettings/groupSettings';
|
|
@@ -40,14 +40,25 @@ export declare class API {
|
|
|
40
40
|
static setAllAc(desiredState: boolean): void;
|
|
41
41
|
/**
|
|
42
42
|
* Changes the status of a given Lamp
|
|
43
|
+
* @deprecated Use "API.lampSetLight" instead
|
|
44
|
+
* TODO: Remove deprecated API method
|
|
43
45
|
* @param {string} deviceId The device Id of the lamp
|
|
44
46
|
* @param {boolean} state The desired new state
|
|
45
47
|
* @param timeout Desired time after which this should be reverted to normal state
|
|
46
48
|
* @returns {Error | null} In case it failed the Error containing the reason
|
|
47
49
|
*/
|
|
48
50
|
static setLamp(deviceId: string, state: boolean, timeout?: number): Error | null;
|
|
51
|
+
/**
|
|
52
|
+
* Changes the status of a given Lamp
|
|
53
|
+
* @param {string} deviceId The device Id of the lamp
|
|
54
|
+
* @param {LampSetLightCommand} c The command(stack) to perform on the lamp
|
|
55
|
+
* @returns {Error | null} In case it failed the Error containing the reason.
|
|
56
|
+
*/
|
|
57
|
+
static lampSetLight(deviceId: string, c: LampSetLightCommand): Error | null;
|
|
49
58
|
/**
|
|
50
59
|
* Changes the status of a given actuator
|
|
60
|
+
* @deprecated Use "API.actuatorSetState" instead
|
|
61
|
+
* TODO: Remove deprecated API method
|
|
51
62
|
* @param {string} deviceId The device Id of the actuator
|
|
52
63
|
* @param {boolean} state The desired new state
|
|
53
64
|
* @param timeout Desired time after which this should be reverted to automatic state
|
|
@@ -57,6 +68,15 @@ export declare class API {
|
|
|
57
68
|
/**
|
|
58
69
|
* Changes the status of a given actuator
|
|
59
70
|
* @param {string} deviceId The device Id of the actuator
|
|
71
|
+
* @param {ActuatorSetStateCommand} c The command(stack) to perform on the actuator
|
|
72
|
+
* @returns {Error | null} In case it failed the Error containing the reason
|
|
73
|
+
*/
|
|
74
|
+
static actuatorSetState(deviceId: string, c: ActuatorSetStateCommand): Error | null;
|
|
75
|
+
/**
|
|
76
|
+
* Changes the status of the given dimmer
|
|
77
|
+
* @deprecated Use "API.dimmerSetLight" instead
|
|
78
|
+
* TODO: Remove deprecated API method
|
|
79
|
+
* @param {string} deviceId The device Id of the actuator
|
|
60
80
|
* @param {boolean} state The desired new state
|
|
61
81
|
* @param timeout A chosen Timeout after which the light should be reset
|
|
62
82
|
* @param brightness The desired brightness
|
|
@@ -65,7 +85,16 @@ export declare class API {
|
|
|
65
85
|
*/
|
|
66
86
|
static setDimmer(deviceId: string, state: boolean, timeout?: number, brightness?: number, transitionTime?: number): Error | null;
|
|
67
87
|
/**
|
|
68
|
-
* Changes the status of
|
|
88
|
+
* Changes the status of the given dimmer
|
|
89
|
+
* @param {string} deviceId The device Id of the dimmable device.
|
|
90
|
+
* @param {DimmerSetLightCommand} command The command(stack) to perform on the dimmer
|
|
91
|
+
* @returns {Error | null} In case it failed the Error containing the reason.
|
|
92
|
+
*/
|
|
93
|
+
static dimmerSetLight(deviceId: string, command: DimmerSetLightCommand): Error | null;
|
|
94
|
+
/**
|
|
95
|
+
* Changes the status of a given led-device
|
|
96
|
+
* @deprecated Use "API.ledSetLight" instead
|
|
97
|
+
* TODO: Remove deprecated API method
|
|
69
98
|
* @param {string} deviceId The device Id of the actuator
|
|
70
99
|
* @param {boolean} state The desired new state
|
|
71
100
|
* @param timeout A chosen Timeout after which the light should be reset
|
|
@@ -76,14 +105,30 @@ export declare class API {
|
|
|
76
105
|
* @returns {Error | null} In case it failed the Error containing the reason
|
|
77
106
|
*/
|
|
78
107
|
static setLedLamp(deviceId: string, state: boolean, timeout?: number, brightness?: number, transitionTime?: number, color?: string, colorTemp?: number): Error | null;
|
|
108
|
+
/**
|
|
109
|
+
* Changes the status of a given led-device
|
|
110
|
+
* @param {string} deviceId The device Id of the LED-Device
|
|
111
|
+
* @param {LedSetLightCommand} command The command(stack) to perform on the led-device
|
|
112
|
+
*/
|
|
113
|
+
static ledSetLight(deviceId: string, command: LedSetLightCommand): Error | null;
|
|
79
114
|
/**
|
|
80
115
|
* Changes the position of a given shutter
|
|
81
116
|
* if needed this updates the window position as well
|
|
117
|
+
* @deprecated Use "API.shutterSetLevel" instead
|
|
118
|
+
* TODO: Remove deprecated API method
|
|
82
119
|
* @param {string} deviceId The device Id of the shutter
|
|
83
120
|
* @param {number} level The desired new level (0 being open, 100 being closed)
|
|
84
121
|
* @returns {Error | null} Error if there is no shutter with the given id
|
|
85
122
|
*/
|
|
86
123
|
static setShutter(deviceId: string, level: number): Error | null;
|
|
124
|
+
/**
|
|
125
|
+
* Changes the position of a given shutter
|
|
126
|
+
* if needed this updates the window position as well
|
|
127
|
+
* @param {string} deviceId The device Id of the shutter
|
|
128
|
+
* @param {ShutterSetLevelCommand} command The command(stack) to perform on the shutter
|
|
129
|
+
* @returns {Error | null} Error if there is no shutter with the given id
|
|
130
|
+
*/
|
|
131
|
+
static shutterSetLevel(deviceId: string, command: ShutterSetLevelCommand): Error | null;
|
|
87
132
|
static speakOnDevice(deviceId: string, message: string, volume?: number): Error | null;
|
|
88
133
|
/**
|
|
89
134
|
* Starts a specified scene
|
|
@@ -113,17 +158,35 @@ export declare class API {
|
|
|
113
158
|
static loadAllDeviceSettingsFromDb(): void;
|
|
114
159
|
/**
|
|
115
160
|
* Lifts a previously started Block of automatic
|
|
161
|
+
* @deprecated Use "API.blockAutomaticLiftAutomaticBlock" instead
|
|
162
|
+
* TODO: Remove deprecated API method
|
|
116
163
|
* @param {string} deviceId The target device
|
|
117
164
|
* @returns {Error | null} In case it failed the Error containing the reason
|
|
118
165
|
*/
|
|
119
166
|
static liftAutomaticBlock(deviceId: string): Error | null;
|
|
167
|
+
/**
|
|
168
|
+
* Lifts a previously started Block of automatic
|
|
169
|
+
* @param {string} deviceId The target device
|
|
170
|
+
* @param {BlockAutomaticLiftBlockCommand} command The command to lift the automatic block
|
|
171
|
+
* @returns {Error | null} In case it failed the Error containing the reason
|
|
172
|
+
*/
|
|
173
|
+
static blockAutomaticLiftAutomaticBlock(deviceId: string, command: BlockAutomaticLiftBlockCommand): Error | null;
|
|
120
174
|
/**
|
|
121
175
|
* Blocks the automatic of the given device for provided Duration
|
|
176
|
+
* @deprecated Use "API.blockAutomaticDisable" instead
|
|
177
|
+
* TODO: Remove deprecated API method
|
|
122
178
|
* @param {string} deviceId The target device
|
|
123
179
|
* @param {number} duration The duration in ms for which the device should remain in current state
|
|
124
180
|
* @param {CollisionSolving} onCollision The desired Collision Solving strategy, in case the automatic being blocked already
|
|
125
181
|
* @returns {Error | null} In case it failed the Error containing the reason
|
|
126
182
|
*/
|
|
127
183
|
static blockAutomatic(deviceId: string, duration: number, onCollision?: CollisionSolving): Error | null;
|
|
184
|
+
/**
|
|
185
|
+
* Blocks the automatic of the given device for provided Duration
|
|
186
|
+
* @param {string} deviceId The target device
|
|
187
|
+
* @param {BlockAutomaticCommand} command The command to block the automatic
|
|
188
|
+
* @returns {Error | null} In case it failed the Error containing the reason
|
|
189
|
+
*/
|
|
190
|
+
static blockAutomaticSetBlock(deviceId: string, command: BlockAutomaticCommand): Error | null;
|
|
128
191
|
static pressButtonSwitch(deviceId: string, position: ButtonPosition, pressType: ButtonPressType): Error | null;
|
|
129
192
|
}
|