hoffmation-base 3.0.0-alpha.2 → 3.0.0-alpha.21

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.
Files changed (185) hide show
  1. package/lib/liquid-pid.d.ts +2 -5
  2. package/lib/liquid-pid.js +2 -5
  3. package/lib/models/command/ShutterSetLevelCommand.d.ts +7 -0
  4. package/lib/models/command/ShutterSetLevelCommand.js +8 -1
  5. package/lib/models/command/WindowRestoreDesiredPositionCommand.d.ts +5 -0
  6. package/lib/models/command/WindowRestoreDesiredPositionCommand.js +5 -0
  7. package/lib/models/command/WindowSetDesiredPositionCommand.d.ts +6 -0
  8. package/lib/models/command/WindowSetDesiredPositionCommand.js +6 -0
  9. package/lib/models/command/WindowSetRolloByWeatherStatusCommand.d.ts +5 -0
  10. package/lib/models/command/WindowSetRolloByWeatherStatusCommand.js +5 -0
  11. package/lib/models/command/actuatorSetStateCommand.d.ts +7 -0
  12. package/lib/models/command/actuatorSetStateCommand.js +9 -2
  13. package/lib/models/command/actuatorToggleCommand.d.ts +5 -0
  14. package/lib/models/command/actuatorToggleCommand.js +6 -1
  15. package/lib/models/command/actuatorWriteStateToDeviceCommand.d.ts +7 -1
  16. package/lib/models/command/actuatorWriteStateToDeviceCommand.js +12 -2
  17. package/lib/models/command/baseCommand.d.ts +14 -1
  18. package/lib/models/command/baseCommand.js +40 -6
  19. package/lib/models/command/blockAutomaticCommand.d.ts +17 -0
  20. package/lib/models/command/blockAutomaticCommand.js +22 -0
  21. package/lib/models/command/blockAutomaticLiftBlockCommand.d.ts +12 -0
  22. package/lib/models/command/blockAutomaticLiftBlockCommand.js +17 -0
  23. package/lib/models/command/blockAutomaticUntilCommand.d.ts +17 -0
  24. package/lib/models/command/blockAutomaticUntilCommand.js +22 -0
  25. package/lib/models/command/commandSource.d.ts +19 -0
  26. package/lib/models/command/commandSource.js +20 -0
  27. package/lib/models/command/commandType.d.ts +3 -0
  28. package/lib/models/command/commandType.js +3 -0
  29. package/lib/models/command/dimmerSetLightCommand.d.ts +7 -6
  30. package/lib/models/command/dimmerSetLightCommand.js +13 -11
  31. package/lib/models/command/floorSetAllShuttersCommand.d.ts +4 -4
  32. package/lib/models/command/floorSetAllShuttersCommand.js +4 -4
  33. package/lib/models/command/index.d.ts +3 -0
  34. package/lib/models/command/index.js +7 -1
  35. package/lib/models/command/lampSetLightCommand.d.ts +7 -0
  36. package/lib/models/command/lampSetLightCommand.js +8 -1
  37. package/lib/models/command/lampSetTimeBasedCommand.d.ts +4 -4
  38. package/lib/models/command/lampSetTimeBasedCommand.js +5 -5
  39. package/lib/models/command/lampToggleLightCommand.d.ts +5 -5
  40. package/lib/models/command/lampToggleLightCommand.js +6 -6
  41. package/lib/models/command/ledSetLightCommand.d.ts +15 -9
  42. package/lib/models/command/ledSetLightCommand.js +16 -10
  43. package/lib/models/command/lightGroupSwitchTimeConditionalCommand.d.ts +6 -0
  44. package/lib/models/command/lightGroupSwitchTimeConditionalCommand.js +6 -0
  45. package/lib/models/command/restoreTargetAutomaticValueCommand.d.ts +5 -0
  46. package/lib/models/command/restoreTargetAutomaticValueCommand.js +6 -1
  47. package/lib/models/command/roomRestoreLightCommand.d.ts +5 -0
  48. package/lib/models/command/roomRestoreLightCommand.js +5 -0
  49. package/lib/models/command/roomRestoreShutterPositionCommand.d.ts +6 -0
  50. package/lib/models/command/roomRestoreShutterPositionCommand.js +6 -0
  51. package/lib/models/command/roomSetLightTimeBasedCommand.d.ts +3 -3
  52. package/lib/models/command/roomSetLightTimeBasedCommand.js +3 -3
  53. package/lib/models/command/shutterSunriseUpCommand.d.ts +5 -0
  54. package/lib/models/command/shutterSunriseUpCommand.js +5 -0
  55. package/lib/models/command/shutterSunsetDownCommand.d.ts +5 -0
  56. package/lib/models/command/shutterSunsetDownCommand.js +5 -0
  57. package/lib/models/command/wledSetLightCommand.d.ts +11 -0
  58. package/lib/models/command/wledSetLightCommand.js +13 -0
  59. package/lib/models/connectionCallbacks.d.ts +4 -4
  60. package/lib/models/deviceConfig.d.ts +2 -2
  61. package/lib/models/deviceSettings/acSettings.d.ts +6 -5
  62. package/lib/models/deviceSettings/acSettings.js +10 -8
  63. package/lib/models/deviceSettings/actuatorSettings.d.ts +13 -4
  64. package/lib/models/deviceSettings/actuatorSettings.js +19 -9
  65. package/lib/models/deviceSettings/garageDoorOpenerSettings.d.ts +0 -1
  66. package/lib/models/deviceSettings/garageDoorOpenerSettings.js +0 -1
  67. package/lib/models/deviceSettings/heaterSettings.d.ts +0 -6
  68. package/lib/models/deviceSettings/heaterSettings.js +0 -6
  69. package/lib/models/deviceSettings/ledSettings.js +10 -18
  70. package/lib/models/deviceSettings/motionSensorSettings.d.ts +0 -1
  71. package/lib/models/deviceSettings/motionSensorSettings.js +0 -1
  72. package/lib/models/deviceSettings/shutterSettings.d.ts +0 -3
  73. package/lib/models/deviceSettings/shutterSettings.js +0 -3
  74. package/lib/models/deviceSettings/wledSettings.js +5 -13
  75. package/lib/models/groupSettings/heatGroupSettings.d.ts +3 -1
  76. package/lib/models/groupSettings/heatGroupSettings.js +3 -1
  77. package/lib/models/iIdHolder.d.ts +6 -0
  78. package/lib/models/objectSettings.d.ts +2 -2
  79. package/lib/models/objectSettings.js +2 -2
  80. package/lib/models/rooms/RoomBase.d.ts +2 -1
  81. package/lib/models/rooms/RoomBase.js +4 -3
  82. package/lib/models/rooms/iRoomBase.d.ts +17 -0
  83. package/lib/models/rooms/iRoomImportEnforcer.d.ts +4 -0
  84. package/lib/server/devices/Griffe.js +0 -1
  85. package/lib/server/devices/IoBrokerBaseDevice.d.ts +11 -16
  86. package/lib/server/devices/IoBrokerBaseDevice.js +21 -17
  87. package/lib/server/devices/IoBrokerDeviceInfo.d.ts +2 -2
  88. package/lib/server/devices/IoBrokerDeviceInfo.js +6 -4
  89. package/lib/server/devices/baseDeviceInterfaces/iAcDevice.d.ts +30 -3
  90. package/lib/server/devices/baseDeviceInterfaces/iActuator.d.ts +16 -0
  91. package/lib/server/devices/baseDeviceInterfaces/iBaseDevice.d.ts +25 -0
  92. package/lib/server/devices/baseDeviceInterfaces/iBatteryDevice.d.ts +10 -1
  93. package/lib/server/devices/baseDeviceInterfaces/iBluetoothDetector.d.ts +5 -5
  94. package/lib/server/devices/baseDeviceInterfaces/iButtonSwitch.d.ts +13 -0
  95. package/lib/server/devices/baseDeviceInterfaces/iCameraDevice.d.ts +10 -0
  96. package/lib/server/devices/baseDeviceInterfaces/iDimmableLamp.d.ts +9 -2
  97. package/lib/server/devices/baseDeviceInterfaces/iEnergyManager.d.ts +13 -2
  98. package/lib/server/devices/baseDeviceInterfaces/iExcessEnergyConsumer.d.ts +16 -2
  99. package/lib/server/devices/baseDeviceInterfaces/iGarageDoorOpener.d.ts +10 -0
  100. package/lib/server/devices/baseDeviceInterfaces/iHandleSensor.d.ts +12 -0
  101. package/lib/server/devices/baseDeviceInterfaces/iHeater.d.ts +12 -2
  102. package/lib/server/devices/baseDeviceInterfaces/iHumiditySensor.d.ts +7 -0
  103. package/lib/server/devices/baseDeviceInterfaces/iLamp.d.ts +4 -0
  104. package/lib/server/devices/baseDeviceInterfaces/iLedRgbCct.d.ts +5 -0
  105. package/lib/server/devices/baseDeviceInterfaces/iMotionSensor.d.ts +7 -1
  106. package/lib/server/devices/baseDeviceInterfaces/iScene.d.ts +7 -0
  107. package/lib/server/devices/baseDeviceInterfaces/iShutter.d.ts +7 -0
  108. package/lib/server/devices/baseDeviceInterfaces/iSmokeDetectorDevice.d.ts +7 -0
  109. package/lib/server/devices/baseDeviceInterfaces/iSpeaker.d.ts +25 -0
  110. package/lib/server/devices/baseDeviceInterfaces/iTemperatureSensor.d.ts +11 -0
  111. package/lib/server/devices/baseDeviceInterfaces/iTemporaryDisableAutomatic.d.ts +7 -0
  112. package/lib/server/devices/baseDeviceInterfaces/iTvDevice.d.ts +12 -0
  113. package/lib/server/devices/baseDeviceInterfaces/iVibrationSensor.d.ts +0 -1
  114. package/lib/server/devices/blueIris/cameraDevice.d.ts +2 -3
  115. package/lib/server/devices/blueIris/cameraDevice.js +2 -3
  116. package/lib/server/devices/dachs/interfaces/KeyListEntity.d.ts +0 -8
  117. package/lib/server/devices/dachs/interfaces/KeyListEntity.js +0 -8
  118. package/lib/server/devices/dachs/lib/dachsHttpClient.d.ts +1 -1
  119. package/lib/server/devices/groups/Window.d.ts +1 -0
  120. package/lib/server/devices/groups/Window.js +1 -0
  121. package/lib/server/devices/groups/heatGroup.d.ts +7 -6
  122. package/lib/server/devices/groups/heatGroup.js +8 -9
  123. package/lib/server/devices/groups/lightGroup.d.ts +2 -2
  124. package/lib/server/devices/groups/lightGroup.js +11 -10
  125. package/lib/server/devices/groups/presenceGroup.d.ts +0 -1
  126. package/lib/server/devices/groups/presenceGroup.js +0 -1
  127. package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.d.ts +0 -1
  128. package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.js +0 -6
  129. package/lib/server/devices/hmIPDevices/hmIpLampe.js +1 -2
  130. package/lib/server/devices/hmIPDevices/hmIpRoll.js +2 -2
  131. package/lib/server/devices/iDeviceUpdater.d.ts +11 -0
  132. package/lib/server/devices/jsObject/jsObjectEnergyManager.d.ts +1 -1
  133. package/lib/server/devices/jsObject/jsObjectEnergyManager.js +1 -1
  134. package/lib/server/devices/sharedFunctions/lampUtils.d.ts +1 -0
  135. package/lib/server/devices/sharedFunctions/lampUtils.js +32 -15
  136. package/lib/server/devices/wledDevice.d.ts +1 -0
  137. package/lib/server/devices/wledDevice.js +13 -8
  138. package/lib/server/devices/zigbee/BaseDevices/ZigbeeActuator.js +1 -2
  139. package/lib/server/devices/zigbee/BaseDevices/zigbeeDevice.d.ts +0 -2
  140. package/lib/server/devices/zigbee/BaseDevices/zigbeeDevice.js +9 -18
  141. package/lib/server/devices/zigbee/BaseDevices/zigbeeDimmer.js +8 -8
  142. package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.d.ts +2 -1
  143. package/lib/server/devices/zigbee/BaseDevices/zigbeeLedRGBCCT.js +6 -4
  144. package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.d.ts +1 -1
  145. package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.js +1 -1
  146. package/lib/server/devices/zigbee/BaseDevices/zigbeeShutter.js +3 -3
  147. package/lib/server/devices/zigbee/BaseDevices/zigbeeSwitch.d.ts +1 -1
  148. package/lib/server/devices/zigbee/zigbeeAquaraVibra.d.ts +1 -1
  149. package/lib/server/devices/zigbee/zigbeeEuroHeater.d.ts +2 -3
  150. package/lib/server/devices/zigbee/zigbeeEuroHeater.js +2 -3
  151. package/lib/server/ioBroker/connection.d.ts +20 -20
  152. package/lib/server/ioBroker/connection.js +29 -21
  153. package/lib/server/ioBroker/socketIOConnectOptions.d.ts +2 -2
  154. package/lib/server/ioBroker/socketIOVisCommand.d.ts +5 -1
  155. package/lib/server/services/Sonos/polly-service.js +1 -2
  156. package/lib/server/services/Translation/res.d.ts +34 -19
  157. package/lib/server/services/Translation/res.js +34 -19
  158. package/lib/server/services/ac/ac-device.d.ts +0 -5
  159. package/lib/server/services/ac/ac-device.js +17 -18
  160. package/lib/server/services/ac/daikin-service.js +2 -1
  161. package/lib/server/services/ac/own-daikin-device.js +12 -4
  162. package/lib/server/services/api/api-service.d.ts +117 -52
  163. package/lib/server/services/api/api-service.js +160 -68
  164. package/lib/server/services/blockAutomaticHandler.d.ts +6 -8
  165. package/lib/server/services/blockAutomaticHandler.js +15 -13
  166. package/lib/server/services/dbo/iPersist.d.ts +96 -0
  167. package/lib/server/services/govee/own-govee-device.js +4 -7
  168. package/lib/server/services/https-service.d.ts +3 -2
  169. package/lib/server/services/https-service.js +3 -2
  170. package/lib/server/services/log-service/log-service.d.ts +2 -2
  171. package/lib/server/services/log-service/log-service.js +2 -2
  172. package/lib/server/services/news-service.d.ts +5 -6
  173. package/lib/server/services/news-service.js +5 -6
  174. package/lib/server/services/room-service/room-service.d.ts +3 -2
  175. package/lib/server/services/room-service/room-service.js +4 -3
  176. package/lib/server/services/settings-service.d.ts +3 -2
  177. package/lib/server/services/settings-service.js +3 -2
  178. package/lib/server/services/utils/iDisposeable.d.ts +3 -0
  179. package/lib/server/services/victron/victron-device.d.ts +2 -2
  180. package/lib/server/services/victron/victron-device.js +2 -2
  181. package/lib/server/services/weather/weather-current.d.ts +0 -2
  182. package/lib/server/services/weather/weather-service.d.ts +4 -1
  183. package/lib/server/services/weather/weather-service.js +4 -0
  184. package/lib/tsconfig.tsbuildinfo +1 -1
  185. package/package.json +6 -5
@@ -11,115 +11,130 @@ class Res {
11
11
  this.translations = resources_json_1.default;
12
12
  }
13
13
  /**
14
- * Retrieves a string like `Alarm system arming."`
14
+ * @returns Retrieves a string like `Alarm system arming."`
15
15
  */
16
16
  static alarmArmed() {
17
17
  return this.fill(this.translations.alarmArmed);
18
18
  }
19
19
  /**
20
- * Retrieves a string like `Alarm system will be armed in night mode. Sweet Dreams!"`
20
+ * @returns Retrieves a string like `Alarm system will be armed in night mode. Sweet Dreams!"`
21
21
  */
22
22
  static alarmNightModeArmed() {
23
23
  return this.fill(this.translations.alarmNightModeArmed);
24
24
  }
25
25
  /**
26
- * Retrieves a string like `"@P0" closed after @P1 minutes`
26
+ * @param deviceCustomName - The custom name of the device
27
+ * @param minutes - The minutes the device was closed after
28
+ * @returns Retrieves a string like `"@P0" closed after @P1 minutes`
27
29
  */
28
30
  static closedAfterMinutes(deviceCustomName, minutes) {
29
31
  return this.fill(this.translations.closedAfterMinutes, [deviceCustomName, minutes]);
30
32
  }
31
33
  /**
32
- * Retrieves a string like `No more smoke: Danger in "@P0" resolved.`
34
+ * @param roomName - The name of the room
35
+ * @returns Retrieves a string like `No more smoke: Danger in "@P0" resolved.`
33
36
  */
34
37
  static fireAlarmEnd(roomName) {
35
38
  return this.fill(this.translations.fireAlarmEnd, [roomName]);
36
39
  }
37
40
  /**
38
- * Retrieves a string like `Smoke detector "@P0" active. Possible fire in "@P1".`
41
+ * @param roomName - The name of the room
42
+ * @param deviceCustomName - The custom name of the device
43
+ * @returns Retrieves a string like `Smoke detector "@P0" active. Possible fire in "@P1".`
39
44
  */
40
45
  static fireAlarmRepeat(roomName, deviceCustomName) {
41
46
  return this.fill(this.translations.fireAlarmRepeat, [roomName, deviceCustomName]);
42
47
  }
43
48
  /**
44
- * Retrieves a string like `Smoke detector "@P0" triggered. Possible fire in "@P1".`
49
+ * @param roomName - The name of the room
50
+ * @param deviceCustomName - The custom name of the device
51
+ * @returns Retrieves a string like `Smoke detector "@P0" triggered. Possible fire in "@P1".`
45
52
  */
46
53
  static fireAlarmStart(roomName, deviceCustomName) {
47
54
  return this.fill(this.translations.fireAlarmStart, [roomName, deviceCustomName]);
48
55
  }
49
56
  /**
50
- * Retrieves a string like `Good Morning`
57
+ * @returns Retrieves a string like `Good Morning`
51
58
  */
52
59
  static goodMorning() {
53
60
  return this.fill(this.translations.goodMorning);
54
61
  }
55
62
  /**
56
- * Retrieves a string like "Alarm. Intruder detected"
63
+ * @returns Retrieves a string like "Alarm. Intruder detected"
57
64
  */
58
65
  static intruderAlarm() {
59
66
  return this.fill(this.translations.intruderAlarm);
60
67
  }
61
68
  /**
62
- * Retrieves a string like "Additional defense protocol initiated."
69
+ * @returns Retrieves a string like "Additional defense protocol initiated."
63
70
  */
64
71
  static intruderAdditionalDefenseWarning() {
65
72
  return this.fill(this.translations.intruderAdditionalDefenseWarning);
66
73
  }
67
74
  /**
68
- * Retrieves a string like "Hello potential intruder! You're beeing recorded and the alarm protocol is initiated please leave the building immediately!"
75
+ * @returns Retrieves a string like "Hello potential intruder! You're beeing recorded and the alarm protocol is initiated please leave the building immediately!"
69
76
  */
70
77
  static intruderGreeting() {
71
78
  return this.fill(this.translations.intruderGreeting);
72
79
  }
73
80
  /**
74
- * Retrieves a string like "Leave now! The owners and additional emergency contacts are informed!"
81
+ * @returns Retrieves a string like "Leave now! The owners and additional emergency contacts are informed!"
75
82
  */
76
83
  static intruderLeaveAndOwnerInformed() {
77
84
  return this.fill(this.translations.intruderLeaveAndOwnerInformed);
78
85
  }
79
86
  /**
80
- * Retrieves a string like "All shutter are opening, please leave immediatly."
87
+ * @returns Retrieves a string like "All shutter are opening, please leave immediatly."
81
88
  */
82
89
  static intruderShutterUpPleaseLeave() {
83
90
  return this.fill(this.translations.intruderShutterUpPleaseLeave);
84
91
  }
85
92
  /**
86
- * Retrieves a string like `"@P0" just closed`
93
+ * @param deviceCustomName - The custom name of the device
94
+ * @returns Retrieves a string like `"@P0" just closed`
87
95
  */
88
96
  static justClosed(deviceCustomName) {
89
97
  return this.fill(this.translations.justClosed, [deviceCustomName]);
90
98
  }
91
99
  /**
92
- * Retrieves a string like `Vibration Alert from "@P0". I repeat: Alarm at "@P0"`
100
+ * @param deviceCustomName - The custom name of the device
101
+ * @returns Retrieves a string like `Vibration Alert from "@P0". I repeat: Alarm at "@P0"`
93
102
  */
94
103
  static vibrationAlarm(deviceCustomName) {
95
104
  return this.fill(this.translations.vibrationAlarm, [deviceCustomName]);
96
105
  }
97
106
  /**
98
- * Retrieves a string like `Water alarm end: Flooding in "@P0" over.`
107
+ * @param roomName - The name of the room
108
+ * @returns Retrieves a string like `Water alarm end: Flooding in "@P0" over.`
99
109
  */
100
110
  static waterAlarmEnd(roomName) {
101
111
  return this.fill(this.translations.waterAlarmEnd, [roomName]);
102
112
  }
103
113
  /**
104
- * Retrieves a string like `"@P0" has triggered. Pool party in "@P1".`
114
+ * @param deviceCustomName - The custom name of the device
115
+ * @param roomName - The name of the room
116
+ * @returns Retrieves a string like `"@P0" has triggered. Pool party in "@P1".`
105
117
  */
106
118
  static waterAlarmRepeat(deviceCustomName, roomName) {
107
119
  return this.fill(this.translations.waterAlarmRepeat, [deviceCustomName, roomName]);
108
120
  }
109
121
  /**
110
- * Retrieves a string like `"@P0" detects water. Possible pipe burst in "@P1".`
122
+ * @param deviceCustomName - The custom name of the device
123
+ * @param roomName - The name of the room
124
+ * @returns Retrieves a string like `"@P0" detects water. Possible pipe burst in "@P1".`
111
125
  */
112
126
  static waterAlarmStart(deviceCustomName, roomName) {
113
127
  return this.fill(this.translations.waterAlarmStart, [deviceCustomName, roomName]);
114
128
  }
115
129
  /**
116
- * Retrieves a string like "Vibration Alert from "@P0". I repeat: Alarm at "@P0""
130
+ * @returns Retrieves a string like "Vibration Alert from "@P0". I repeat: Alarm at "@P0""
117
131
  */
118
132
  static welcomeHome() {
119
133
  return this.fill(this.translations.welcomeHome);
120
134
  }
121
135
  /**
122
- * Retrieves a string like `"@P0" was opened`
136
+ * @param deviceCustomName - The custom name of the device
137
+ * @returns Retrieves a string like `"@P0" was opened`
123
138
  */
124
139
  static wasOpened(deviceCustomName) {
125
140
  return this.fill(this.translations.wasOpened, [deviceCustomName]);
@@ -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;
@@ -52,7 +52,7 @@ class AcDevice {
52
52
  this._info.customName = `${roomName} ${name}`;
53
53
  this._info.room = roomName;
54
54
  this._info.allDevicesKey = `ac-${roomName}-${name}`;
55
- utils_1.Utils.guardedInterval(this.automaticCheck, 5 * 60 * 1000, this, true);
55
+ utils_1.Utils.guardedInterval(this.automaticCheck, 5 * 60 * 1000, this, false);
56
56
  utils_1.Utils.guardedInterval(this.persist, 15 * 60 * 1000, this, true);
57
57
  this.persistDeviceInfo();
58
58
  this.loadDeviceSettings();
@@ -85,7 +85,8 @@ class AcDevice {
85
85
  this.automaticCheck();
86
86
  }
87
87
  isAvailableForExcessEnergy() {
88
- if (this.settings.useOwnTemperatureAndAutomatic) {
88
+ var _a, _b;
89
+ if (this.settings.useAutomatic || (((_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup) === null || _b === void 0 ? void 0 : _b.settings.automaticMode) && this.settings.heatingAllowed)) {
89
90
  return false;
90
91
  }
91
92
  if (this.blockAutomationHandler.automaticBlockActive) {
@@ -97,9 +98,14 @@ class AcDevice {
97
98
  return this.calculateDesiredMode() !== ac_mode_1.AcMode.Off;
98
99
  }
99
100
  calculateDesiredMode() {
100
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
101
+ var _a, _b, _c, _d, _e, _f, _g;
101
102
  const acOn = this.on;
102
- this._desiredTemperatur = (_c = (_b = (_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup) === null || _b === void 0 ? void 0 : _b.desiredTemp) !== null && _c !== void 0 ? _c : 0;
103
+ const heatGroup = (_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup;
104
+ if (!heatGroup) {
105
+ this.log(models_1.LogLevel.Warn, `Can't calculate AC Mode as we have no heat group`);
106
+ return ac_mode_1.AcMode.Off;
107
+ }
108
+ this._desiredTemperatur = heatGroup.desiredTemp;
103
109
  if (this.settings.manualDisabled) {
104
110
  acOn && this.log(models_1.LogLevel.Info, `We should turn off now, as manual disable force is set.`);
105
111
  return ac_mode_1.AcMode.Off;
@@ -109,16 +115,15 @@ class AcDevice {
109
115
  acOn && this.log(models_1.LogLevel.Info, `We should turn off now, to respect night settings.`);
110
116
  return ac_mode_1.AcMode.Off;
111
117
  }
112
- const heatGroup = (_d = this.room) === null || _d === void 0 ? void 0 : _d.HeatGroup;
113
- if (this.settings.useOwnTemperatureAndAutomatic) {
118
+ if (this.settings.useOwnTemperature) {
114
119
  // Device is in automatic mode so ignore energy and room temperature
115
- if ((heatGroup === null || heatGroup === void 0 ? void 0 : heatGroup.settings.automaticMode) === false) {
120
+ if (this.settings.useAutomatic) {
116
121
  return ac_mode_1.AcMode.Auto;
117
122
  }
118
123
  if (settings_service_1.SettingsService.heatMode !== config_1.HeatingMode.Sommer && this.settings.heatingAllowed) {
119
124
  return ac_mode_1.AcMode.Heating;
120
125
  }
121
- if (!this.settings.noCoolingOnMovement || ((_f = (_e = this.room) === null || _e === void 0 ? void 0 : _e.PraesenzGroup) === null || _f === void 0 ? void 0 : _f.anyPresent()) !== true) {
126
+ if (!this.settings.noCoolingOnMovement || ((_c = (_b = this.room) === null || _b === void 0 ? void 0 : _b.PraesenzGroup) === null || _c === void 0 ? void 0 : _c.anyPresent()) !== true) {
122
127
  return ac_mode_1.AcMode.Cooling;
123
128
  }
124
129
  return ac_mode_1.AcMode.Off;
@@ -135,7 +140,7 @@ class AcDevice {
135
140
  let threshold = acOn ? 0.5 : 1.5;
136
141
  let thresholdHeating = acOn ? 0.5 : 1.5;
137
142
  let desiredMode = ac_mode_1.AcMode.Off;
138
- const excessEnergy = (_h = (_g = devices_1.Devices.energymanager) === null || _g === void 0 ? void 0 : _g.excessEnergy) !== null && _h !== void 0 ? _h : -1;
143
+ const excessEnergy = (_e = (_d = devices_1.Devices.energymanager) === null || _d === void 0 ? void 0 : _d.excessEnergy) !== null && _e !== void 0 ? _e : -1;
139
144
  if ((acOn ? 200 : 1000) < excessEnergy) {
140
145
  // As there is plenty of energy to spare we plan to overshoot the target by 1 degree
141
146
  threshold = -0.5;
@@ -146,7 +151,7 @@ class AcDevice {
146
151
  const heatUntil = targetTemp - thresholdHeating;
147
152
  if (temp > coolUntil && settings_service_1.SettingsService.heatMode === config_1.HeatingMode.Sommer) {
148
153
  desiredMode = ac_mode_1.AcMode.Cooling;
149
- if (this.settings.noCoolingOnMovement && ((_k = (_j = this.room) === null || _j === void 0 ? void 0 : _j.PraesenzGroup) === null || _k === void 0 ? void 0 : _k.anyPresent()) === true) {
154
+ if (this.settings.noCoolingOnMovement && ((_g = (_f = this.room) === null || _f === void 0 ? void 0 : _f.PraesenzGroup) === null || _g === void 0 ? void 0 : _g.anyPresent()) === true) {
150
155
  return ac_mode_1.AcMode.Off;
151
156
  }
152
157
  }
@@ -158,13 +163,6 @@ class AcDevice {
158
163
  }
159
164
  return desiredMode;
160
165
  }
161
- /**
162
- * Disable automatic Turn-On and Turn-Off for given amount of ms.
163
- * @param {number} timeout
164
- */
165
- deactivateAutomaticChange(timeout = 60 * 60 * 1000) {
166
- this.blockAutomationHandler.disableAutomatic(timeout);
167
- }
168
166
  onTemperaturChange(newTemperatur) {
169
167
  this.roomTemperatur = newTemperatur;
170
168
  }
@@ -186,8 +184,9 @@ class AcDevice {
186
184
  turnOffDueToMissingEnergy() {
187
185
  this.turnOff();
188
186
  }
187
+ // TODO: Migrate to new command system
189
188
  setState(mode, desiredTemp, forceTime = 60 * 60 * 1000) {
190
- this.blockAutomationHandler.disableAutomatic(forceTime);
189
+ this.blockAutomationHandler.disableAutomatic(new models_1.BlockAutomaticCommand(models_1.CommandSource.Unknown, forceTime));
191
190
  this._mode = mode;
192
191
  if (mode == ac_mode_1.AcMode.Off) {
193
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.deactivateAutomaticChange(180 * 60 * 1000);
85
+ dev.blockAutomationHandler.disableAutomatic(new models_1.BlockAutomaticCommand(models_1.CommandSource.Unknown, 180 * 60 * 1000));
85
86
  }
86
87
  }
87
88
  }
@@ -86,13 +86,21 @@ class OwnDaikinDevice extends ac_device_1.AcDevice {
86
86
  });
87
87
  }
88
88
  setDesiredInfo(retry = false, forceTemp) {
89
- var _a;
89
+ var _a, _b;
90
+ if (this._desiredTemperatur === devices_1.UNDEFINED_TEMP_VALUE) {
91
+ if (((_a = this.room) === null || _a === void 0 ? void 0 : _a.HeatGroup) === undefined) {
92
+ this.log(models_1.LogLevel.Error, `Neither desired temperature nor HeatGroup is set for ${this.name}(${this.ip})`);
93
+ return;
94
+ }
95
+ this._desiredTemperatur = this.room.HeatGroup.desiredTemp;
96
+ return;
97
+ }
90
98
  let targetTemp = this._desiredTemperatur;
91
99
  if (this.desiredMode == daikin_controller_1.Mode.HOT) {
92
- targetTemp = this.settings.useOwnTemperatureAndAutomatic ? targetTemp + 1 : 29;
100
+ targetTemp = this.settings.useOwnTemperature ? targetTemp : 29;
93
101
  }
94
102
  else if (this.desiredMode == daikin_controller_1.Mode.COLD) {
95
- targetTemp = this.settings.useOwnTemperatureAndAutomatic ? targetTemp - 1 : 16;
103
+ targetTemp = this.settings.useOwnTemperature ? targetTemp : 16;
96
104
  }
97
105
  const changeObject = {
98
106
  power: this.desiredState,
@@ -100,7 +108,7 @@ class OwnDaikinDevice extends ac_device_1.AcDevice {
100
108
  targetHumidity: this.desiredHum,
101
109
  targetTemperature: forceTemp !== null && forceTemp !== void 0 ? forceTemp : targetTemp,
102
110
  };
103
- (_a = this.device) === null || _a === void 0 ? void 0 : _a.setACControlInfo(changeObject, (err, res) => {
111
+ (_b = this.device) === null || _b === void 0 ? void 0 : _b.setACControlInfo(changeObject, (err, res) => {
104
112
  var _a;
105
113
  if (err !== null) {
106
114
  log_service_1.ServerLogService.writeLog(models_1.LogLevel.Warn, `Setting Ac Info for ${this.name} failed: ${err} `);
@@ -1,19 +1,19 @@
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';
6
6
  export declare class API {
7
7
  /**
8
8
  * Endpoint to end a scene manually (or early if it has automatic turn off)
9
- * @param {string} deviceId
10
- * @returns {Error | null}
9
+ * @param deviceId - The id of the scene to end
10
+ * @returns In case it failed the Error containing the reason
11
11
  */
12
12
  static endScene(deviceId: string): Error | null;
13
13
  /**
14
14
  * Gets the instance of an Ac Device identified by id
15
- * @param {string} id
16
- * @returns {OwnDaikinDevice | undefined}
15
+ * @param id - The device id of the AC
16
+ * @returns The instance of the AC Device or undefined if not found
17
17
  */
18
18
  static getAc(id: string): AcDevice | undefined;
19
19
  static getDevices(): {
@@ -26,86 +26,133 @@ export declare class API {
26
26
  static getLog(): LogObject[];
27
27
  /**
28
28
  * Turns on/off one AC identified by it's id
29
- * @param id The id of the device, if wrong false will be returned
30
- * @param {boolean} desiredState
31
- * @param {AcMode} desiredMode
32
- * @param desiredTemperature
33
- * @param forceTime The time in ms this should not change before automatic change is allowed again
29
+ * @param id - The id of the device, if wrong false will be returned
30
+ * @param desiredState - The desired state for the AC
31
+ * @param desiredMode - The desired mode for the AC
32
+ * @param desiredTemperature - The desired temperature for the AC in Celsius
33
+ * @param forceTime - The time in ms this should not change before automatic change is allowed again
34
+ * @returns True if the AC was found and the state was changed
34
35
  */
35
36
  static setAc(id: string, desiredState: boolean, desiredMode?: AcMode, desiredTemperature?: number, forceTime?: number): boolean;
36
37
  /**
37
38
  * Turns on/off all AC´s in the home
38
- * @param {boolean} desiredState
39
+ * @param desiredState - The desired state for all AC´s
39
40
  */
40
41
  static setAllAc(desiredState: boolean): void;
41
42
  /**
42
43
  * Changes the status of a given Lamp
43
- * @param {string} deviceId The device Id of the lamp
44
- * @param {boolean} state The desired new state
45
- * @param timeout Desired time after which this should be reverted to normal state
46
- * @returns {Error | null} In case it failed the Error containing the reason
44
+ * @param deviceId - The device Id of the lamp
45
+ * @param state - The desired new state
46
+ * @param timeout - Desired time after which this should be reverted to normal state
47
+ * @returns In case it failed the Error containing the reason
48
+ * @deprecated Use "API.lampSetLight" instead
49
+ * TODO: Remove deprecated API method
47
50
  */
48
51
  static setLamp(deviceId: string, state: boolean, timeout?: number): Error | null;
52
+ /**
53
+ * Changes the status of a given Lamp
54
+ * @param deviceId - The device Id of the lamp
55
+ * @param c - The command(stack) to perform on the lamp
56
+ * @returns In case it failed the Error containing the reason.
57
+ */
58
+ static lampSetLight(deviceId: string, c: LampSetLightCommand): Error | null;
49
59
  /**
50
60
  * Changes the status of a given actuator
51
- * @param {string} deviceId The device Id of the actuator
52
- * @param {boolean} state The desired new state
53
- * @param timeout Desired time after which this should be reverted to automatic state
54
- * @returns {Error | null} In case it failed the Error containing the reason
61
+ * @param deviceId - The device Id of the actuator
62
+ * @param state - The desired new state
63
+ * @param timeout - Desired time after which this should be reverted to automatic state
64
+ * @returns In case it failed the Error containing the reason
65
+ * @deprecated Use "API.actuatorSetState" instead
66
+ * TODO: Remove deprecated API method
55
67
  */
56
68
  static setActuator(deviceId: string, state: boolean, timeout?: number): Error | null;
57
69
  /**
58
70
  * Changes the status of a given actuator
59
- * @param {string} deviceId The device Id of the actuator
60
- * @param {boolean} state The desired new state
61
- * @param timeout A chosen Timeout after which the light should be reset
62
- * @param brightness The desired brightness
63
- * @param transitionTime The transition time during turnOn/turnOff
64
- * @returns {Error | null} In case it failed the Error containing the reason
71
+ * @param deviceId - The device Id of the actuator
72
+ * @param c - The command(stack) to perform on the actuator
73
+ * @returns In case it failed the Error containing the reason
74
+ */
75
+ static actuatorSetState(deviceId: string, c: ActuatorSetStateCommand): Error | null;
76
+ /**
77
+ * Changes the status of the given dimmer
78
+ * @param deviceId - The device Id of the actuator
79
+ * @param state - The desired new state
80
+ * @param timeout - A chosen Timeout after which the light should be reset
81
+ * @param brightness - The desired brightness
82
+ * @param transitionTime - The transition time during turnOn/turnOff
83
+ * @returns In case it failed the Error containing the reason
84
+ * @deprecated Use "API.dimmerSetLight" instead
85
+ * TODO: Remove deprecated API method
65
86
  */
66
87
  static setDimmer(deviceId: string, state: boolean, timeout?: number, brightness?: number, transitionTime?: number): Error | null;
67
88
  /**
68
- * Changes the status of a given actuator
69
- * @param {string} deviceId The device Id of the actuator
70
- * @param {boolean} state The desired new state
71
- * @param timeout A chosen Timeout after which the light should be reset
72
- * @param brightness The desired brightness
73
- * @param transitionTime The transition time during turnOn/turnOff
74
- * @param {string} color The desired color in 6 digit hex Code
75
- * @param {number} colorTemp The desired color Temperature (0 = more White)
76
- * @returns {Error | null} In case it failed the Error containing the reason
89
+ * Changes the status of the given dimmer
90
+ * @param deviceId - The device Id of the dimmable device.
91
+ * @param command - The command(stack) to perform on the dimmer
92
+ * @returns In case it failed the Error containing the reason.
93
+ */
94
+ static dimmerSetLight(deviceId: string, command: DimmerSetLightCommand): Error | null;
95
+ /**
96
+ * Changes the status of a given led-device
97
+ * @param deviceId - The device Id of the actuator
98
+ * @param state - The desired new state
99
+ * @param timeout - A chosen Timeout after which the light should be reset
100
+ * @param brightness - The desired brightness
101
+ * @param transitionTime - The transition time during turnOn/turnOff
102
+ * @param color - The desired color in 6 digit hex Code
103
+ * @param colorTemp - The desired color Temperature (0 = more White)
104
+ * @returns In case it failed the Error containing the reason
105
+ * @deprecated Use "API.ledSetLight" instead
106
+ * TODO: Remove deprecated API method
77
107
  */
78
108
  static setLedLamp(deviceId: string, state: boolean, timeout?: number, brightness?: number, transitionTime?: number, color?: string, colorTemp?: number): Error | null;
109
+ /**
110
+ * Changes the status of a given led-device
111
+ * @param deviceId - The device Id of the LED-Device
112
+ * @param command - The command(stack) to perform on the led-device
113
+ * @returns In case it failed the Error containing the reason
114
+ */
115
+ static ledSetLight(deviceId: string, command: LedSetLightCommand): Error | null;
79
116
  /**
80
117
  * Changes the position of a given shutter
81
118
  * if needed this updates the window position as well
82
- * @param {string} deviceId The device Id of the shutter
83
- * @param {number} level The desired new level (0 being open, 100 being closed)
84
- * @returns {Error | null} Error if there is no shutter with the given id
119
+ * @param deviceId - The device Id of the shutter
120
+ * @param level - The desired new level (0 being open, 100 being closed)
121
+ * @returns Error if there is no shutter with the given id
122
+ * @deprecated Use "API.shutterSetLevel" instead
123
+ * TODO: Remove deprecated API method
85
124
  */
86
125
  static setShutter(deviceId: string, level: number): Error | null;
126
+ /**
127
+ * Changes the position of a given shutter
128
+ * if needed this updates the window position as well
129
+ * @param deviceId - The device Id of the shutter
130
+ * @param command - The command(stack) to perform on the shutter
131
+ * @returns Error if there is no shutter with the given id
132
+ */
133
+ static shutterSetLevel(deviceId: string, command: ShutterSetLevelCommand): Error | null;
87
134
  static speakOnDevice(deviceId: string, message: string, volume?: number): Error | null;
88
135
  /**
89
136
  * Starts a specified scene
90
- * @param {string} deviceId The targeted scene
91
- * @param {number} turnOffTimeout If provided the time in ms after which the scene should end automatically
92
- * @returns {Error | null} In case it failed the Error containing the reason
137
+ * @param deviceId - The targeted scene
138
+ * @param turnOffTimeout - If provided the time in ms after which the scene should end automatically
139
+ * @returns In case it failed the Error containing the reason
93
140
  */
94
141
  static startScene(deviceId: string, turnOffTimeout?: number): Error | null;
95
142
  static switchGarageDoor(deviceId: string, open: boolean): Error | null;
96
143
  /**
97
144
  * Changes the settings of a given device
98
- * @param {string} deviceId The id of the device to change the settings
99
- * @param settings A partial settings object containing the wanted settings properties
100
- * @returns {Error | null} In case it failed the Error containing the reason
145
+ * @param deviceId - The id of the device to change the settings
146
+ * @param settings - A partial settings object containing the wanted settings properties
147
+ * @returns In case it failed the Error containing the reason
101
148
  */
102
149
  static setDeviceSettings(deviceId: string, settings: Partial<DeviceSettings>): Error | null;
103
150
  static setGroupSettings(groupId: string, settings: Partial<GroupSettings>): Error | null;
104
151
  /**
105
152
  * Changes the settings of a given room
106
- * @param {string} roomName The id of the Room to change the settings
107
- * @param settings A partial settings object containing the wanted settings properties
108
- * @returns {Error | null} In case it failed the Error containing the reason
153
+ * @param roomName - The id of the Room to change the settings
154
+ * @param settings - A partial settings object containing the wanted settings properties
155
+ * @returns In case it failed the Error containing the reason
109
156
  */
110
157
  static setRoomSettings(roomName: string, settings: Partial<DeviceSettings>): Error | null;
111
158
  static getLastCameraImage(deviceId: string): Error | string;
@@ -113,17 +160,35 @@ export declare class API {
113
160
  static loadAllDeviceSettingsFromDb(): void;
114
161
  /**
115
162
  * Lifts a previously started Block of automatic
116
- * @param {string} deviceId The target device
117
- * @returns {Error | null} In case it failed the Error containing the reason
163
+ * @param deviceId - The target device
164
+ * @returns In case it failed the Error containing the reason
165
+ * @deprecated Use "API.blockAutomaticLiftAutomaticBlock" instead
166
+ * TODO: Remove deprecated API method
118
167
  */
119
168
  static liftAutomaticBlock(deviceId: string): Error | null;
169
+ /**
170
+ * Lifts a previously started Block of automatic
171
+ * @param deviceId - The target device
172
+ * @param command - The command to lift the automatic block
173
+ * @returns In case it failed the Error containing the reason
174
+ */
175
+ static blockAutomaticLiftAutomaticBlock(deviceId: string, command: BlockAutomaticLiftBlockCommand): Error | null;
120
176
  /**
121
177
  * Blocks the automatic of the given device for provided Duration
122
- * @param {string} deviceId The target device
123
- * @param {number} duration The duration in ms for which the device should remain in current state
124
- * @param {CollisionSolving} onCollision The desired Collision Solving strategy, in case the automatic being blocked already
125
- * @returns {Error | null} In case it failed the Error containing the reason
178
+ * @param deviceId - The target device
179
+ * @param duration - The duration in ms for which the device should remain in current state
180
+ * @param onCollision - The desired Collision Solving strategy, in case the automatic being blocked already
181
+ * @returns In case it failed the Error containing the reason
182
+ * @deprecated Use "API.blockAutomaticDisable" instead
183
+ * TODO: Remove deprecated API method
126
184
  */
127
185
  static blockAutomatic(deviceId: string, duration: number, onCollision?: CollisionSolving): Error | null;
186
+ /**
187
+ * Blocks the automatic of the given device for provided Duration
188
+ * @param deviceId - The target device
189
+ * @param command - The command to block the automatic
190
+ * @returns In case it failed the Error containing the reason
191
+ */
192
+ static blockAutomaticSetBlock(deviceId: string, command: BlockAutomaticCommand): Error | null;
128
193
  static pressButtonSwitch(deviceId: string, position: ButtonPosition, pressType: ButtonPressType): Error | null;
129
194
  }