hoffmation-base 3.0.0-alpha.33 → 3.0.0-alpha.34

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.
@@ -3,7 +3,6 @@ import { iRoomDefaultSettings } from './iRoomDefaultSettings';
3
3
  import { iTimePair, SunTimeOffsets } from '../../../server';
4
4
  import { RoomSettings } from './roomSettings';
5
5
  export declare class RoomSettingsController implements iRoomDefaultSettings {
6
- constructor(room: RoomBase);
7
6
  /**
8
7
  * The name of the room this settings are for
9
8
  */
@@ -17,6 +16,7 @@ export declare class RoomSettingsController implements iRoomDefaultSettings {
17
16
  */
18
17
  lampOffset: SunTimeOffsets;
19
18
  private _settingsContainer;
19
+ constructor(room: RoomBase);
20
20
  get settingsContainer(): RoomSettings;
21
21
  get lichtSonnenAufgangAus(): boolean;
22
22
  get ambientLightAfterSunset(): boolean;
@@ -14,7 +14,7 @@ export declare class LampUtils {
14
14
  * @param {DimmerSetLightCommand} c - The command to check
15
15
  * @returns {boolean} - True if the command can be skipped
16
16
  */
17
- static checkDimmerUnchanged(device: iDimmableLamp, c: DimmerSetLightCommand): boolean;
18
- static checkUnchanged(device: iActuator, c: ActuatorSetStateCommand, noLog?: boolean): boolean;
17
+ static canDimmerChangeBeSkipped(device: iDimmableLamp, c: DimmerSetLightCommand): boolean;
18
+ static canActuatorChangeBeSkipped(device: iActuator, c: ActuatorSetStateCommand, noLog?: boolean): boolean;
19
19
  static setActuator(device: iActuator, c: ActuatorSetStateCommand): void;
20
20
  }
@@ -67,11 +67,11 @@ class LampUtils {
67
67
  * @param {DimmerSetLightCommand} c - The command to check
68
68
  * @returns {boolean} - True if the command can be skipped
69
69
  */
70
- static checkDimmerUnchanged(device, c) {
70
+ static canDimmerChangeBeSkipped(device, c) {
71
71
  if (c.isForceAction) {
72
72
  return false;
73
73
  }
74
- if (!this.checkUnchanged(device, c, true)) {
74
+ if (!this.canActuatorChangeBeSkipped(device, c, true)) {
75
75
  return false;
76
76
  }
77
77
  if (c.brightness !== device.brightness) {
@@ -80,11 +80,12 @@ class LampUtils {
80
80
  device.log(models_1.LogLevel.DeepTrace, `Light command can be skipped as the device is already in desired state: ${c.logMessage}`, services_1.LogDebugType.SkipUnchangedActuatorCommand);
81
81
  return true;
82
82
  }
83
- static checkUnchanged(device, c, noLog = false) {
83
+ static canActuatorChangeBeSkipped(device, c, noLog = false) {
84
84
  if (c.isForceAction) {
85
85
  return false;
86
86
  }
87
- if (c.on !== device.queuedValue || (device.queuedValue === null && device.actuatorOn !== c.on)) {
87
+ if ((device.queuedValue === null && device.actuatorOn !== c.on) ||
88
+ (device.queuedValue !== null && c.on === device.queuedValue)) {
88
89
  return false;
89
90
  }
90
91
  if (!noLog) {
@@ -107,7 +108,7 @@ class LampUtils {
107
108
  // Preserve the target state for the automatic handler, as
108
109
  device.targetAutomaticState = c.on;
109
110
  }
110
- if (LampUtils.checkUnchanged(device, c)) {
111
+ if (LampUtils.canActuatorChangeBeSkipped(device, c)) {
111
112
  return;
112
113
  }
113
114
  device.queuedValue = c.on;
@@ -69,7 +69,7 @@ class WledDevice extends IoBrokerBaseDevice_1.IoBrokerBaseDevice {
69
69
  if (sharedFunctions_1.LampUtils.checkBlockActive(this, c)) {
70
70
  return;
71
71
  }
72
- if (sharedFunctions_1.LampUtils.checkDimmerUnchanged(this, c)) {
72
+ if (sharedFunctions_1.LampUtils.canDimmerChangeBeSkipped(this, c)) {
73
73
  return;
74
74
  }
75
75
  if (c.isAutomaticAction) {
@@ -57,7 +57,7 @@ class ZigbeeDimmer extends zigbeeLamp_1.ZigbeeLamp {
57
57
  if (sharedFunctions_1.LampUtils.checkBlockActive(this, c)) {
58
58
  return;
59
59
  }
60
- if (sharedFunctions_1.LampUtils.checkDimmerUnchanged(this, c)) {
60
+ if (sharedFunctions_1.LampUtils.canDimmerChangeBeSkipped(this, c)) {
61
61
  return;
62
62
  }
63
63
  if (c.isAutomaticAction) {
@@ -117,7 +117,7 @@ class OwnGoveeDevice {
117
117
  if (devices_1.LampUtils.checkBlockActive(this, c)) {
118
118
  return;
119
119
  }
120
- if (devices_1.LampUtils.checkDimmerUnchanged(this, c)) {
120
+ if (devices_1.LampUtils.canDimmerChangeBeSkipped(this, c)) {
121
121
  return;
122
122
  }
123
123
  if (c.isAutomaticAction) {