hoffmation-base 3.1.4 → 3.2.1-alpha.0
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/baseAction.d.ts +1 -0
- package/lib/action/baseAction.js +3 -0
- package/lib/command/ShutterSetLevelCommand.d.ts +2 -1
- package/lib/command/WindowRestoreDesiredPositionCommand.d.ts +2 -1
- package/lib/command/WindowSetDesiredPositionCommand.d.ts +2 -1
- package/lib/command/WindowSetRolloByWeatherStatusCommand.d.ts +2 -1
- package/lib/command/actuatorSetStateCommand.d.ts +2 -1
- package/lib/command/actuatorToggleCommand.d.ts +2 -1
- package/lib/command/actuatorWriteStateToDeviceCommand.d.ts +2 -1
- package/lib/command/baseCommand.d.ts +10 -3
- package/lib/command/baseCommand.js +20 -1
- package/lib/command/blockAutomaticCommand.d.ts +2 -1
- package/lib/command/blockAutomaticLiftBlockCommand.d.ts +2 -1
- package/lib/command/blockAutomaticUntilCommand.d.ts +2 -1
- package/lib/command/dimmerSetLightCommand.d.ts +2 -2
- package/lib/command/floorSetAllShuttersCommand.d.ts +2 -1
- package/lib/command/iBaseCommand.d.ts +58 -0
- package/lib/command/iBaseCommand.js +2 -0
- package/lib/command/index.d.ts +1 -0
- package/lib/command/lampSetLightCommand.d.ts +2 -2
- package/lib/command/lampSetTimeBasedCommand.d.ts +2 -1
- package/lib/command/lampToggleLightCommand.d.ts +2 -2
- package/lib/command/ledSetLightCommand.d.ts +2 -2
- package/lib/command/lightGroupSwitchTimeConditionalCommand.d.ts +2 -1
- package/lib/command/restoreTargetAutomaticValueCommand.d.ts +2 -1
- package/lib/command/roomRestoreLightCommand.d.ts +2 -1
- package/lib/command/roomRestoreShutterPositionCommand.d.ts +2 -1
- package/lib/command/roomSetLightTimeBasedCommand.d.ts +2 -1
- package/lib/command/shutterSunriseUpCommand.d.ts +2 -1
- package/lib/command/shutterSunsetDownCommand.d.ts +2 -1
- package/lib/command/wledSetLightCommand.d.ts +2 -2
- package/lib/command/wledSetLightCommand.js +1 -1
- package/lib/devices/BaseDevice.d.ts +43 -0
- package/lib/devices/BaseDevice.js +92 -0
- package/lib/devices/CameraDevice.d.ts +6 -15
- package/lib/devices/CameraDevice.js +33 -51
- package/lib/devices/IoBrokerBaseDevice.d.ts +6 -34
- package/lib/devices/IoBrokerBaseDevice.js +5 -68
- package/lib/devices/RoomBaseDevice.d.ts +9 -0
- package/lib/devices/RoomBaseDevice.js +21 -0
- package/lib/devices/dachs/dachs.d.ts +4 -17
- package/lib/devices/dachs/dachs.js +12 -43
- package/lib/devices/dachs/dachsTemperatureSensor.d.ts +4 -19
- package/lib/devices/dachs/dachsTemperatureSensor.js +11 -37
- package/lib/devices/espresense/detectedBluetoothDevice.d.ts +5 -11
- package/lib/devices/espresense/detectedBluetoothDevice.js +15 -17
- package/lib/devices/espresense/espresenseDevice.d.ts +3 -19
- package/lib/devices/espresense/espresenseDevice.js +11 -45
- package/lib/devices/govee/own-govee-device.d.ts +5 -18
- package/lib/devices/govee/own-govee-device.js +30 -69
- package/lib/devices/groups/heatGroup.js +1 -1
- package/lib/devices/groups/lightGroup.js +1 -1
- package/lib/devices/hmIPDevices/hmIpLampe.js +1 -1
- package/lib/devices/hmIPDevices/hmIpRoll.js +2 -2
- package/lib/devices/index.d.ts +1 -0
- package/lib/devices/index.js +3 -1
- package/lib/devices/scene/room-scene.d.ts +2 -23
- package/lib/devices/scene/room-scene.js +12 -57
- package/lib/devices/sharedFunctions/lampUtils.js +4 -3
- package/lib/devices/shelly/shellyActuator.js +1 -1
- package/lib/devices/tv/tvDevice.d.ts +4 -16
- package/lib/devices/tv/tvDevice.js +12 -36
- package/lib/devices/velux/veluxShutter.js +1 -1
- package/lib/devices/victron/victron-device.d.ts +2 -15
- package/lib/devices/victron/victron-device.js +11 -43
- package/lib/devices/wledDevice.js +2 -2
- package/lib/devices/zigbee/BaseDevices/ZigbeeActuator.js +1 -1
- package/lib/devices/zigbee/BaseDevices/zigbeeShutter.d.ts +0 -3
- package/lib/devices/zigbee/BaseDevices/zigbeeShutter.js +4 -11
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/interfaces/baseDevices/iAcDevice.d.ts +4 -0
- package/lib/interfaces/baseDevices/iBaseDevice.d.ts +11 -1
- package/lib/services/Sonos/own-sonos-device.d.ts +4 -14
- package/lib/services/Sonos/own-sonos-device.js +8 -46
- package/lib/services/ac/ac-device.d.ts +6 -22
- package/lib/services/ac/ac-device.js +23 -53
- package/lib/services/ac/own-daikin-device.js +2 -2
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/utils.d.ts +2 -1
- package/lib/utils/utils.js +15 -2
- package/package.json +1 -1
package/lib/action/baseAction.js
CHANGED
|
@@ -7,5 +7,8 @@ class BaseAction extends command_1.BaseCommand {
|
|
|
7
7
|
constructor(source, reason) {
|
|
8
8
|
super(source !== null && source !== void 0 ? source : enums_1.CommandSource.Automatic, reason);
|
|
9
9
|
}
|
|
10
|
+
get logMessage() {
|
|
11
|
+
return this.reasonTrace;
|
|
12
|
+
}
|
|
10
13
|
}
|
|
11
14
|
exports.BaseAction = BaseAction;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class ShutterSetLevelCommand extends BaseCommand {
|
|
4
5
|
readonly level: number;
|
|
5
6
|
readonly skipOpenWarning: boolean;
|
|
@@ -12,6 +13,6 @@ export declare class ShutterSetLevelCommand extends BaseCommand {
|
|
|
12
13
|
* @param reason - You can provide a reason for clarification
|
|
13
14
|
* @param skipOpenWarning - Whether to skip the warning of window being open
|
|
14
15
|
*/
|
|
15
|
-
constructor(source: CommandSource |
|
|
16
|
+
constructor(source: CommandSource | iBaseCommand, level: number, reason?: string, skipOpenWarning?: boolean);
|
|
16
17
|
get logMessage(): string;
|
|
17
18
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CommandSource, CommandType } from '../enums';
|
|
2
2
|
import { BaseCommand } from './baseCommand';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class WindowRestoreDesiredPositionCommand extends BaseCommand {
|
|
4
5
|
/** @inheritDoc */
|
|
5
6
|
type: CommandType;
|
|
@@ -8,5 +9,5 @@ export declare class WindowRestoreDesiredPositionCommand extends BaseCommand {
|
|
|
8
9
|
* @param source - The source of the command
|
|
9
10
|
* @param reason - You can provide a reason for clarification
|
|
10
11
|
*/
|
|
11
|
-
constructor(source: CommandSource |
|
|
12
|
+
constructor(source: CommandSource | iBaseCommand, reason?: string);
|
|
12
13
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CommandSource, CommandType } from '../enums';
|
|
2
2
|
import { BaseCommand } from './baseCommand';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class WindowSetDesiredPositionCommand extends BaseCommand {
|
|
4
5
|
readonly position: number;
|
|
5
6
|
readonly applyNewPosition: boolean;
|
|
@@ -12,5 +13,5 @@ export declare class WindowSetDesiredPositionCommand extends BaseCommand {
|
|
|
12
13
|
* @param reason - You can provide a reason for clarification
|
|
13
14
|
* @param applyNewPosition - Whether this new position should be applied immediately
|
|
14
15
|
*/
|
|
15
|
-
constructor(source: CommandSource |
|
|
16
|
+
constructor(source: CommandSource | iBaseCommand, position: number, reason?: string, applyNewPosition?: boolean);
|
|
16
17
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class WindowSetRolloByWeatherStatusCommand extends BaseCommand {
|
|
4
5
|
/** @inheritDoc */
|
|
5
6
|
type: CommandType;
|
|
@@ -8,5 +9,5 @@ export declare class WindowSetRolloByWeatherStatusCommand extends BaseCommand {
|
|
|
8
9
|
* @param source - The source of the command
|
|
9
10
|
* @param reason - You can provide a reason for clarification
|
|
10
11
|
*/
|
|
11
|
-
constructor(source: CommandSource |
|
|
12
|
+
constructor(source: CommandSource | iBaseCommand, reason?: string);
|
|
12
13
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
3
|
import { BlockAutomaticCommand } from './blockAutomaticCommand';
|
|
4
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
4
5
|
export declare class ActuatorSetStateCommand extends BaseCommand {
|
|
5
6
|
readonly on: boolean;
|
|
6
7
|
/** @inheritDoc */
|
|
@@ -19,6 +20,6 @@ export declare class ActuatorSetStateCommand extends BaseCommand {
|
|
|
19
20
|
* @param disableAutomatic - If provided, the device will remain in the desired state for the given disable action.
|
|
20
21
|
* If unset the default value in accordance to settings will be used
|
|
21
22
|
*/
|
|
22
|
-
constructor(source: CommandSource |
|
|
23
|
+
constructor(source: CommandSource | iBaseCommand, on: boolean, reason?: string, disableAutomatic?: BlockAutomaticCommand | null);
|
|
23
24
|
get logMessage(): string;
|
|
24
25
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class ActuatorToggleCommand extends BaseCommand {
|
|
4
5
|
/** @inheritDoc */
|
|
5
6
|
type: CommandType;
|
|
@@ -8,5 +9,5 @@ export declare class ActuatorToggleCommand extends BaseCommand {
|
|
|
8
9
|
* @param source - The source of the command
|
|
9
10
|
* @param reason - You can provide a reason for clarification
|
|
10
11
|
*/
|
|
11
|
-
constructor(source: CommandSource |
|
|
12
|
+
constructor(source: CommandSource | iBaseCommand, reason?: string);
|
|
12
13
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class ActuatorWriteStateToDeviceCommand extends BaseCommand {
|
|
4
5
|
readonly stateValue: boolean;
|
|
5
6
|
/** @inheritDoc */
|
|
@@ -10,6 +11,6 @@ export declare class ActuatorWriteStateToDeviceCommand extends BaseCommand {
|
|
|
10
11
|
* @param stateValue - The new state of the actuator
|
|
11
12
|
* @param reason - You can provide a reason for clarification
|
|
12
13
|
*/
|
|
13
|
-
constructor(source: CommandSource |
|
|
14
|
+
constructor(source: CommandSource | iBaseCommand, stateValue: boolean, reason?: string);
|
|
14
15
|
get logMessage(): string;
|
|
15
16
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CommandSource, CommandType } from '../enums';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
|
+
export declare abstract class BaseCommand implements iBaseCommand {
|
|
4
|
+
readonly source: CommandSource | iBaseCommand;
|
|
4
5
|
readonly reason: string;
|
|
5
6
|
/**
|
|
6
7
|
* The timestamp of the command being created
|
|
@@ -17,16 +18,22 @@ export declare abstract class BaseCommand {
|
|
|
17
18
|
* @type {CommandSource | undefined} The source of the command
|
|
18
19
|
*/
|
|
19
20
|
overrideCommandSource: CommandSource | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* If set, describes why this command wasn't executed.
|
|
23
|
+
*/
|
|
24
|
+
ignoreReason: string | undefined;
|
|
20
25
|
/**
|
|
21
26
|
* Base class for all commands
|
|
22
27
|
* @param source - The source of the command
|
|
23
28
|
* @param reason - You can provide a reason for clarification
|
|
24
29
|
*/
|
|
25
|
-
protected constructor(source?: CommandSource |
|
|
30
|
+
protected constructor(source?: CommandSource | iBaseCommand, reason?: string);
|
|
26
31
|
get isAutomaticAction(): boolean;
|
|
27
32
|
get isForceAction(): boolean;
|
|
28
33
|
get isManual(): boolean;
|
|
29
34
|
get isInitial(): boolean;
|
|
30
35
|
get reasonTrace(): string;
|
|
31
36
|
containsType(type: CommandType): boolean;
|
|
37
|
+
get logMessage(): string;
|
|
38
|
+
toJSON(): Partial<BaseCommand>;
|
|
32
39
|
}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.BaseCommand = void 0;
|
|
4
7
|
const enums_1 = require("../enums");
|
|
8
|
+
const lodash_1 = __importDefault(require("lodash"));
|
|
5
9
|
class BaseCommand {
|
|
6
10
|
/**
|
|
7
11
|
* Base class for all commands
|
|
@@ -52,7 +56,13 @@ class BaseCommand {
|
|
|
52
56
|
return this.source === enums_1.CommandSource.Initial;
|
|
53
57
|
}
|
|
54
58
|
get reasonTrace() {
|
|
55
|
-
|
|
59
|
+
let ownPart = `${this.type}`;
|
|
60
|
+
if (this.reason !== undefined) {
|
|
61
|
+
ownPart += `("${this.reason}")`;
|
|
62
|
+
}
|
|
63
|
+
if (this.ignoreReason !== undefined) {
|
|
64
|
+
ownPart += ` ignored due to: "${this.ignoreReason}"`;
|
|
65
|
+
}
|
|
56
66
|
if (typeof this.source === 'object') {
|
|
57
67
|
return `${this.source.reasonTrace} -> ${ownPart}`;
|
|
58
68
|
}
|
|
@@ -67,5 +77,14 @@ class BaseCommand {
|
|
|
67
77
|
}
|
|
68
78
|
return false;
|
|
69
79
|
}
|
|
80
|
+
get logMessage() {
|
|
81
|
+
return this.reasonTrace;
|
|
82
|
+
}
|
|
83
|
+
toJSON() {
|
|
84
|
+
// eslint-disable-next-line
|
|
85
|
+
const result = lodash_1.default.omit(this, ['source']);
|
|
86
|
+
result['logMessage'] = this.logMessage;
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
70
89
|
}
|
|
71
90
|
exports.BaseCommand = BaseCommand;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CollisionSolving, CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class BlockAutomaticCommand extends BaseCommand {
|
|
4
5
|
/**
|
|
5
6
|
* Whether at Block-Lift the desired automatic state should be restored.
|
|
@@ -35,6 +36,6 @@ export declare class BlockAutomaticCommand extends BaseCommand {
|
|
|
35
36
|
* @param onCollideAction - The action to take if a block is already active. --> Default: {@link SettingsService.settings.blockAutomaticHandlerDefaults.defaultCollisionSolving}
|
|
36
37
|
* @param revertToAutomaticAtBlockLift - Whether the device should revert to automatic afterward. --> Default: {@link SettingsService.settings.blockAutomaticHandlerDefaults.revertToAutomaticAtBlockLift}
|
|
37
38
|
*/
|
|
38
|
-
constructor(source: CommandSource |
|
|
39
|
+
constructor(source: CommandSource | iBaseCommand, durationMS?: number, reason?: string, onCollideAction?: CollisionSolving, revertToAutomaticAtBlockLift?: boolean);
|
|
39
40
|
get logMessage(): string;
|
|
40
41
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class BlockAutomaticLiftBlockCommand extends BaseCommand {
|
|
4
5
|
/** @inheritDoc */
|
|
5
6
|
type: CommandType;
|
|
@@ -13,5 +14,5 @@ export declare class BlockAutomaticLiftBlockCommand extends BaseCommand {
|
|
|
13
14
|
* @param reason - You can provide an individual reason here for debugging purpose.
|
|
14
15
|
* @param revertToAutomatic - Whether the device should revert to automatic afterward. --> Default: {@link SettingsService.settings.blockAutomaticHandlerDefaults.revertToAutomaticAtBlockLift}
|
|
15
16
|
*/
|
|
16
|
-
constructor(source: CommandSource |
|
|
17
|
+
constructor(source: CommandSource | iBaseCommand, reason?: string, revertToAutomatic?: boolean);
|
|
17
18
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CollisionSolving, CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class BlockAutomaticUntilCommand extends BaseCommand {
|
|
4
5
|
targetDate: Date;
|
|
5
6
|
/** @inheritDoc */
|
|
@@ -20,6 +21,6 @@ export declare class BlockAutomaticUntilCommand extends BaseCommand {
|
|
|
20
21
|
* @param onCollideAction - The action to take if a block is already active. --> Default: {@link SettingsService.settings.blockAutomaticHandlerDefaults.defaultCollisionSolving}
|
|
21
22
|
* @param revertToAutomaticAtBlockLift - Whether the device should revert to automatic afterward. --> Default: {@link SettingsService.settings.blockAutomaticHandlerDefaults.revertToAutomaticAtBlockLift}
|
|
22
23
|
*/
|
|
23
|
-
constructor(source: CommandSource |
|
|
24
|
+
constructor(source: CommandSource | iBaseCommand, targetDate: Date, reason?: string, onCollideAction?: CollisionSolving, revertToAutomaticAtBlockLift?: boolean);
|
|
24
25
|
get logMessage(): string;
|
|
25
26
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LampSetLightCommand } from './lampSetLightCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
-
import { BaseCommand } from './baseCommand';
|
|
4
3
|
import { BlockAutomaticCommand } from './blockAutomaticCommand';
|
|
4
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
5
5
|
export declare class DimmerSetLightCommand extends LampSetLightCommand {
|
|
6
6
|
brightness: number;
|
|
7
7
|
transitionTime: number;
|
|
@@ -17,7 +17,7 @@ export declare class DimmerSetLightCommand extends LampSetLightCommand {
|
|
|
17
17
|
* @param brightness - The desired brightness
|
|
18
18
|
* @param transitionTime - The transition time during turnOn/turnOff
|
|
19
19
|
*/
|
|
20
|
-
constructor(source: CommandSource |
|
|
20
|
+
constructor(source: CommandSource | iBaseCommand, on: boolean, reason?: string, disableAutomatic?: BlockAutomaticCommand | null, brightness?: number, transitionTime?: number);
|
|
21
21
|
/** @inheritDoc */
|
|
22
22
|
get logMessage(): string;
|
|
23
23
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class FloorSetAllShuttersCommand extends BaseCommand {
|
|
4
5
|
readonly position: number;
|
|
5
6
|
readonly specificFloor: number | undefined;
|
|
@@ -12,5 +13,5 @@ export declare class FloorSetAllShuttersCommand extends BaseCommand {
|
|
|
12
13
|
* @param specificFloor - undefined = all floors
|
|
13
14
|
* @param reason - You can provide a reason for clarity
|
|
14
15
|
*/
|
|
15
|
-
constructor(source: CommandSource |
|
|
16
|
+
constructor(source: CommandSource | iBaseCommand, position: number, specificFloor?: number | undefined, reason?: string);
|
|
16
17
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { CommandSource, CommandType } from '../enums';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export interface iBaseCommand {
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
timestamp: Date;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
type: CommandType;
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
overrideCommandSource: CommandSource | undefined;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
readonly source: CommandSource | iBaseCommand;
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
readonly reason: string;
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
ignoreReason?: string;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
readonly isAutomaticAction: boolean;
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
readonly isForceAction: boolean;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
readonly isManual: boolean;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
readonly isInitial: boolean;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
*/
|
|
49
|
+
readonly reasonTrace: string;
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
readonly logMessage: string;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
containsType(type: CommandType): boolean;
|
|
58
|
+
}
|
package/lib/command/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { RestoreTargetAutomaticValueCommand } from './restoreTargetAutomaticValu
|
|
|
5
5
|
export { ActuatorSetStateCommand } from './actuatorSetStateCommand';
|
|
6
6
|
export { ActuatorToggleCommand } from './actuatorToggleCommand';
|
|
7
7
|
export { ActuatorWriteStateToDeviceCommand } from './actuatorWriteStateToDeviceCommand';
|
|
8
|
+
export { iBaseCommand } from './iBaseCommand';
|
|
8
9
|
export { BaseCommand } from './baseCommand';
|
|
9
10
|
export { DimmerSetLightCommand } from './dimmerSetLightCommand';
|
|
10
11
|
export { FloorSetAllShuttersCommand } from './floorSetAllShuttersCommand';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ActuatorSetStateCommand } from './actuatorSetStateCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
-
import { BaseCommand } from './baseCommand';
|
|
4
3
|
import { BlockAutomaticCommand } from './blockAutomaticCommand';
|
|
4
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
5
5
|
export declare class LampSetLightCommand extends ActuatorSetStateCommand {
|
|
6
6
|
/** @inheritDoc */
|
|
7
7
|
type: CommandType;
|
|
@@ -13,7 +13,7 @@ export declare class LampSetLightCommand extends ActuatorSetStateCommand {
|
|
|
13
13
|
* @param disableAutomatic - If provided, the device will remain in the desired state for the given disable action.
|
|
14
14
|
* If undefined the default value will be used in case it's a non automatic action: {@link SettingsService.settings.blockAutomaticHandlerDefaults}
|
|
15
15
|
*/
|
|
16
|
-
constructor(source: CommandSource |
|
|
16
|
+
constructor(source: CommandSource | iBaseCommand, on: boolean, reason?: string, disableAutomatic?: BlockAutomaticCommand | null);
|
|
17
17
|
/** @inheritDoc */
|
|
18
18
|
get logMessage(): string;
|
|
19
19
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType, TimeOfDay } from '../enums';
|
|
3
3
|
import { BlockAutomaticCommand } from './blockAutomaticCommand';
|
|
4
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
4
5
|
export declare class LampSetTimeBasedCommand extends BaseCommand {
|
|
5
6
|
time: TimeOfDay;
|
|
6
7
|
/** @inheritDoc */
|
|
@@ -19,5 +20,5 @@ export declare class LampSetTimeBasedCommand extends BaseCommand {
|
|
|
19
20
|
* @param disableAutomatic - If provided, the device will remain in the desired state for the given disable action.
|
|
20
21
|
* If undefined the default value will be used in case it's a non automatic action: {@link SettingsService.settings.blockAutomaticHandlerDefaults}
|
|
21
22
|
*/
|
|
22
|
-
constructor(source: CommandSource |
|
|
23
|
+
constructor(source: CommandSource | iBaseCommand, time: TimeOfDay, reason?: string, disableAutomatic?: BlockAutomaticCommand | null);
|
|
23
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommandSource, CommandType, TimeOfDay } from '../enums';
|
|
2
2
|
import { ActuatorToggleCommand } from './actuatorToggleCommand';
|
|
3
|
-
import {
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
4
4
|
export declare class LampToggleLightCommand extends ActuatorToggleCommand {
|
|
5
5
|
time?: TimeOfDay | undefined;
|
|
6
6
|
readonly calculateTime: boolean;
|
|
@@ -13,6 +13,6 @@ export declare class LampToggleLightCommand extends ActuatorToggleCommand {
|
|
|
13
13
|
* @param time - The time to use for calculation of desired state
|
|
14
14
|
* @param calculateTime - Alternative to "time", if set the time will be calculated by the lamps room and its settings
|
|
15
15
|
*/
|
|
16
|
-
constructor(source: CommandSource |
|
|
16
|
+
constructor(source: CommandSource | iBaseCommand, reason?: string, time?: TimeOfDay | undefined, calculateTime?: boolean);
|
|
17
17
|
get logMessage(): string;
|
|
18
18
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DimmerSetLightCommand } from './dimmerSetLightCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
-
import { BaseCommand } from './baseCommand';
|
|
4
3
|
import { BlockAutomaticCommand } from './blockAutomaticCommand';
|
|
4
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
5
5
|
export declare class LedSetLightCommand extends DimmerSetLightCommand {
|
|
6
6
|
color: string;
|
|
7
7
|
colorTemp: number;
|
|
@@ -19,7 +19,7 @@ export declare class LedSetLightCommand extends DimmerSetLightCommand {
|
|
|
19
19
|
* @param color - The desired color in 6 digit hex Code
|
|
20
20
|
* @param colorTemp - The desired color Temperature (0 = more White)
|
|
21
21
|
*/
|
|
22
|
-
constructor(source: CommandSource |
|
|
22
|
+
constructor(source: CommandSource | iBaseCommand, on: boolean, reason?: string, disableAutomatic?: BlockAutomaticCommand | null, brightness?: number, transitionTime?: number, color?: string, colorTemp?: number);
|
|
23
23
|
/** @inheritDoc */
|
|
24
24
|
get logMessage(): string;
|
|
25
25
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType, TimeOfDay } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class LightGroupSwitchTimeConditionalCommand extends BaseCommand {
|
|
4
5
|
readonly time: TimeOfDay;
|
|
5
6
|
/** @inheritDoc */
|
|
@@ -10,5 +11,5 @@ export declare class LightGroupSwitchTimeConditionalCommand extends BaseCommand
|
|
|
10
11
|
* @param time - The time of the day to switch the light group
|
|
11
12
|
* @param reason - You can provide a reason for clarification
|
|
12
13
|
*/
|
|
13
|
-
constructor(source: CommandSource |
|
|
14
|
+
constructor(source: CommandSource | iBaseCommand, time: TimeOfDay, reason?: string);
|
|
14
15
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CommandSource, CommandType } from '../enums';
|
|
2
2
|
import { BaseCommand } from './baseCommand';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class RestoreTargetAutomaticValueCommand extends BaseCommand {
|
|
4
5
|
/** @inheritDoc */
|
|
5
6
|
type: CommandType;
|
|
@@ -8,5 +9,5 @@ export declare class RestoreTargetAutomaticValueCommand extends BaseCommand {
|
|
|
8
9
|
* @param source - The source of the command
|
|
9
10
|
* @param reason - You can provide a reason for clarification
|
|
10
11
|
*/
|
|
11
|
-
constructor(source: CommandSource |
|
|
12
|
+
constructor(source: CommandSource | iBaseCommand, reason?: string);
|
|
12
13
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class RoomRestoreLightCommand extends BaseCommand {
|
|
4
5
|
/** @inheritDoc */
|
|
5
6
|
type: CommandType;
|
|
@@ -8,5 +9,5 @@ export declare class RoomRestoreLightCommand extends BaseCommand {
|
|
|
8
9
|
* @param source - The source of the command
|
|
9
10
|
* @param reason - You can provide a reason for clarification
|
|
10
11
|
*/
|
|
11
|
-
constructor(source: CommandSource |
|
|
12
|
+
constructor(source: CommandSource | iBaseCommand, reason?: string);
|
|
12
13
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class RoomRestoreShutterPositionCommand extends BaseCommand {
|
|
4
5
|
readonly recalc: boolean;
|
|
5
6
|
/** @inheritDoc */
|
|
@@ -10,5 +11,5 @@ export declare class RoomRestoreShutterPositionCommand extends BaseCommand {
|
|
|
10
11
|
* @param recalc - Whether to recalculate the shutter position
|
|
11
12
|
* @param reason - You can provide a reason for clarification
|
|
12
13
|
*/
|
|
13
|
-
constructor(source: CommandSource |
|
|
14
|
+
constructor(source: CommandSource | iBaseCommand, recalc?: boolean, reason?: string);
|
|
14
15
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class RoomSetLightTimeBasedCommand extends BaseCommand {
|
|
4
5
|
readonly movementDependant: boolean;
|
|
5
6
|
/** @inheritDoc */
|
|
@@ -10,5 +11,5 @@ export declare class RoomSetLightTimeBasedCommand extends BaseCommand {
|
|
|
10
11
|
* @param movementDependant - Only turn light on if there was a movement in the same room
|
|
11
12
|
* @param reason - You can provide a reason for clarity
|
|
12
13
|
*/
|
|
13
|
-
constructor(source: CommandSource |
|
|
14
|
+
constructor(source: CommandSource | iBaseCommand, movementDependant?: boolean, reason?: string);
|
|
14
15
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class ShutterSunriseUpCommand extends BaseCommand {
|
|
4
5
|
/** @inheritDoc */
|
|
5
6
|
type: CommandType;
|
|
@@ -8,5 +9,5 @@ export declare class ShutterSunriseUpCommand extends BaseCommand {
|
|
|
8
9
|
* @param source - The source of the command
|
|
9
10
|
* @param reason - You can provide a reason for clarification
|
|
10
11
|
*/
|
|
11
|
-
constructor(source: CommandSource |
|
|
12
|
+
constructor(source: CommandSource | iBaseCommand, reason?: string);
|
|
12
13
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from './baseCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
3
4
|
export declare class ShutterSunsetDownCommand extends BaseCommand {
|
|
4
5
|
/** @inheritDoc */
|
|
5
6
|
type: CommandType;
|
|
@@ -8,5 +9,5 @@ export declare class ShutterSunsetDownCommand extends BaseCommand {
|
|
|
8
9
|
* @param source - The source of the command
|
|
9
10
|
* @param reason - You can provide a reason for clarification
|
|
10
11
|
*/
|
|
11
|
-
constructor(source: CommandSource |
|
|
12
|
+
constructor(source: CommandSource | iBaseCommand, reason?: string);
|
|
12
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DimmerSetLightCommand } from './dimmerSetLightCommand';
|
|
2
2
|
import { CommandSource, CommandType } from '../enums';
|
|
3
|
-
import { BaseCommand } from './baseCommand';
|
|
4
3
|
import { BlockAutomaticCommand } from './blockAutomaticCommand';
|
|
4
|
+
import { iBaseCommand } from './iBaseCommand';
|
|
5
5
|
export declare class WledSetLightCommand extends DimmerSetLightCommand {
|
|
6
6
|
preset?: number | undefined;
|
|
7
7
|
/** @inheritDoc */
|
|
@@ -17,6 +17,6 @@ export declare class WledSetLightCommand extends DimmerSetLightCommand {
|
|
|
17
17
|
* @param transitionTime - The time in milliseconds the transition should take
|
|
18
18
|
* @param preset - The preset to use
|
|
19
19
|
*/
|
|
20
|
-
constructor(source: CommandSource |
|
|
20
|
+
constructor(source: CommandSource | iBaseCommand, on: boolean, reason?: string, disableAutomatic?: BlockAutomaticCommand | null, brightness?: number, transitionTime?: number, preset?: number | undefined);
|
|
21
21
|
get logMessage(): string;
|
|
22
22
|
}
|
|
@@ -23,7 +23,7 @@ class WledSetLightCommand extends dimmerSetLightCommand_1.DimmerSetLightCommand
|
|
|
23
23
|
}
|
|
24
24
|
get logMessage() {
|
|
25
25
|
var _a;
|
|
26
|
-
return `Dimmer setLight to ${this.on} with Brightness ${this.brightness},
|
|
26
|
+
return `Dimmer setLight to ${this.on} with Brightness ${this.brightness}, disableAutomatic ${(_a = this.disableAutomaticCommand) === null || _a === void 0 ? void 0 : _a.logMessage} and preset ${this.preset} for reason: ${this.reasonTrace}`;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
exports.WledSetLightCommand = WledSetLightCommand;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { iBaseDevice, iDeviceInfo, iDeviceSettings, iPersist } from '../interfaces';
|
|
2
|
+
import { DeviceCapability, DeviceType, LogDebugType, LogLevel } from '../enums';
|
|
3
|
+
import { RingStorage } from '../utils';
|
|
4
|
+
import { RoomBaseDevice } from './RoomBaseDevice';
|
|
5
|
+
import { iBaseCommand } from '../command';
|
|
6
|
+
export declare abstract class BaseDevice implements iBaseDevice {
|
|
7
|
+
protected _info: iDeviceInfo;
|
|
8
|
+
deviceType: DeviceType;
|
|
9
|
+
/** @inheritDoc */
|
|
10
|
+
readonly jsonOmitKeys: string[];
|
|
11
|
+
/** @inheritDoc */
|
|
12
|
+
readonly deviceCapabilities: DeviceCapability[];
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
* @default undefined (no Settings)
|
|
16
|
+
*/
|
|
17
|
+
settings: iDeviceSettings | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The last actions this device performed
|
|
20
|
+
*/
|
|
21
|
+
lastCommands: RingStorage<iBaseCommand>;
|
|
22
|
+
protected _lastWrite: number;
|
|
23
|
+
protected constructor(_info: iDeviceInfo, deviceType: DeviceType);
|
|
24
|
+
/**
|
|
25
|
+
* Getter info
|
|
26
|
+
* @returns The device info
|
|
27
|
+
*/
|
|
28
|
+
get info(): iDeviceInfo;
|
|
29
|
+
/** @inheritDoc */
|
|
30
|
+
get customName(): string;
|
|
31
|
+
/** @inheritDoc */
|
|
32
|
+
get id(): string;
|
|
33
|
+
protected get dbo(): iPersist | undefined;
|
|
34
|
+
protected get anyDboActive(): boolean;
|
|
35
|
+
/** @inheritDoc */
|
|
36
|
+
loadDeviceSettings(): void;
|
|
37
|
+
log(level: LogLevel, message: string, logDebugType?: LogDebugType): void;
|
|
38
|
+
logCommand(c: iBaseCommand, ignoreReason?: string, logDebugType?: LogDebugType, level?: LogLevel): void;
|
|
39
|
+
/** @inheritDoc */
|
|
40
|
+
persistDeviceInfo(): void;
|
|
41
|
+
/** @inheritDoc */
|
|
42
|
+
toJSON(): Partial<RoomBaseDevice>;
|
|
43
|
+
}
|