hoffmation-base 3.2.10-alpha.0 → 3.2.10-alpha.2

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.
@@ -13,14 +13,16 @@ class Window extends base_group_1.BaseGroup {
13
13
  * @returns {number} The level (0 closed, 100 open)
14
14
  */
15
15
  get desiredPosition() {
16
- return this.getShutter().baseAutomaticLevel;
16
+ var _a, _b;
17
+ return (_b = (_a = this.getShutter()) === null || _a === void 0 ? void 0 : _a.baseAutomaticLevel) !== null && _b !== void 0 ? _b : 0;
17
18
  }
18
19
  /**
19
20
  * Checks if any shutter is down (0%)
20
21
  * @returns {boolean} true if any shutter is down
21
22
  */
22
23
  get anyShutterDown() {
23
- return this.getShutter().currentLevel === 0;
24
+ var _a;
25
+ return ((_a = this.getShutter()) === null || _a === void 0 ? void 0 : _a.currentLevel) === 0;
24
26
  }
25
27
  constructor(roomName, handleIds = [], vibrationIds = [], shutterIds = [], magnetIds = []) {
26
28
  super(roomName, enums_1.GroupType.Window);
@@ -88,11 +90,12 @@ class Window extends base_group_1.BaseGroup {
88
90
  (_a = this.getShutter()) === null || _a === void 0 ? void 0 : _a.setLevel(new command_1.ShutterSetLevelCommand(enums_1.CommandSource.Force, services_1.TimeCallbackService.darkOutsideOrNight(timeOfDay) ? 50 : 100, 'Window ajar by handle'));
89
91
  });
90
92
  griff.addOffenCallback((offen) => {
93
+ var _a;
91
94
  if (offen) {
92
95
  this.getVibration().forEach((element) => {
93
96
  element.vibrationBlockedByHandle = true;
94
97
  });
95
- this.getShutter().setLevel(new command_1.ShutterSetLevelCommand(enums_1.CommandSource.Force, 100, 'Window opened by handle'));
98
+ (_a = this.getShutter()) === null || _a === void 0 ? void 0 : _a.setLevel(new command_1.ShutterSetLevelCommand(enums_1.CommandSource.Force, 100, 'Window opened by handle'));
96
99
  return;
97
100
  }
98
101
  });
@@ -19,13 +19,12 @@ export declare class ZigbeeShutter extends ZigbeeDevice implements iShutter {
19
19
  protected _window?: iWindow;
20
20
  /** Implements iTemporaryDisableAutomatic */
21
21
  readonly blockAutomationHandler: BlockAutomaticHandler;
22
- private _targetAutomaticValue;
22
+ /** @inheritDoc */
23
+ targetAutomaticValue: number;
23
24
  /** @inheritDoc */
24
25
  baseAutomaticLevel: number;
25
26
  constructor(pInfo: IoBrokerDeviceInfo, pType: DeviceType);
26
27
  /** @inheritDoc */
27
- get targetAutomaticValue(): number;
28
- /** @inheritDoc */
29
28
  get currentLevel(): number;
30
29
  /** @inheritDoc */
31
30
  get window(): iWindow | undefined;
@@ -23,7 +23,8 @@ class ZigbeeShutter extends zigbeeDevice_1.ZigbeeDevice {
23
23
  this._setLevelTime = -1;
24
24
  this._shutterCalibrationData = new models_1.ShutterCalibration(this.info.fullID, 0, 0, 0, 0);
25
25
  this._currentLevel = -1;
26
- this._targetAutomaticValue = 0;
26
+ /** @inheritDoc */
27
+ this.targetAutomaticValue = 0;
27
28
  /** @inheritDoc */
28
29
  this.baseAutomaticLevel = 0;
29
30
  this.deviceCapabilities.push(enums_1.DeviceCapability.shutter);
@@ -45,10 +46,6 @@ class ZigbeeShutter extends zigbeeDevice_1.ZigbeeDevice {
45
46
  });
46
47
  }
47
48
  /** @inheritDoc */
48
- get targetAutomaticValue() {
49
- return this._targetAutomaticValue;
50
- }
51
- /** @inheritDoc */
52
49
  get currentLevel() {
53
50
  if (this._setLevel !== -1 && this._currentLevel !== this._setLevel) {
54
51
  return this._setLevel;
@@ -131,7 +128,7 @@ class ZigbeeShutter extends zigbeeDevice_1.ZigbeeDevice {
131
128
  * @param command - The command to restore the automatic value/state
132
129
  */
133
130
  restoreTargetAutomaticValue(command) {
134
- this.setLevel(new command_1.ShutterSetLevelCommand(command, this._targetAutomaticValue));
131
+ this.setLevel(new command_1.ShutterSetLevelCommand(command, this.targetAutomaticValue));
135
132
  }
136
133
  initializeMovementFinishTimeout(duration, endPosition) {
137
134
  if (this._iMovementFinishTimeout !== null) {