hoffmation-base 3.0.0-alpha.20 → 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 (159) 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 +7 -1
  5. package/lib/models/command/WindowRestoreDesiredPositionCommand.d.ts +5 -0
  6. package/lib/models/command/WindowRestoreDesiredPositionCommand.js +5 -1
  7. package/lib/models/command/WindowSetDesiredPositionCommand.d.ts +6 -0
  8. package/lib/models/command/WindowSetDesiredPositionCommand.js +6 -1
  9. package/lib/models/command/WindowSetRolloByWeatherStatusCommand.d.ts +5 -0
  10. package/lib/models/command/WindowSetRolloByWeatherStatusCommand.js +5 -1
  11. package/lib/models/command/actuatorSetStateCommand.d.ts +7 -0
  12. package/lib/models/command/actuatorSetStateCommand.js +7 -1
  13. package/lib/models/command/actuatorToggleCommand.d.ts +5 -0
  14. package/lib/models/command/actuatorToggleCommand.js +5 -1
  15. package/lib/models/command/actuatorWriteStateToDeviceCommand.d.ts +6 -0
  16. package/lib/models/command/actuatorWriteStateToDeviceCommand.js +6 -1
  17. package/lib/models/command/baseCommand.d.ts +10 -0
  18. package/lib/models/command/baseCommand.js +16 -1
  19. package/lib/models/command/blockAutomaticCommand.d.ts +4 -4
  20. package/lib/models/command/blockAutomaticCommand.js +4 -4
  21. package/lib/models/command/blockAutomaticLiftBlockCommand.d.ts +2 -2
  22. package/lib/models/command/blockAutomaticLiftBlockCommand.js +2 -2
  23. package/lib/models/command/blockAutomaticUntilCommand.d.ts +4 -4
  24. package/lib/models/command/blockAutomaticUntilCommand.js +4 -4
  25. package/lib/models/command/commandSource.d.ts +19 -0
  26. package/lib/models/command/commandSource.js +20 -1
  27. package/lib/models/command/dimmerSetLightCommand.d.ts +7 -6
  28. package/lib/models/command/dimmerSetLightCommand.js +7 -6
  29. package/lib/models/command/floorSetAllShuttersCommand.d.ts +4 -4
  30. package/lib/models/command/floorSetAllShuttersCommand.js +4 -4
  31. package/lib/models/command/lampSetLightCommand.d.ts +7 -0
  32. package/lib/models/command/lampSetLightCommand.js +7 -1
  33. package/lib/models/command/lampSetTimeBasedCommand.d.ts +4 -4
  34. package/lib/models/command/lampSetTimeBasedCommand.js +4 -4
  35. package/lib/models/command/lampToggleLightCommand.d.ts +5 -5
  36. package/lib/models/command/lampToggleLightCommand.js +5 -5
  37. package/lib/models/command/ledSetLightCommand.d.ts +15 -9
  38. package/lib/models/command/ledSetLightCommand.js +15 -10
  39. package/lib/models/command/lightGroupSwitchTimeConditionalCommand.d.ts +6 -0
  40. package/lib/models/command/lightGroupSwitchTimeConditionalCommand.js +6 -1
  41. package/lib/models/command/restoreTargetAutomaticValueCommand.d.ts +5 -0
  42. package/lib/models/command/restoreTargetAutomaticValueCommand.js +5 -1
  43. package/lib/models/command/roomRestoreLightCommand.d.ts +5 -0
  44. package/lib/models/command/roomRestoreLightCommand.js +5 -1
  45. package/lib/models/command/roomRestoreShutterPositionCommand.d.ts +6 -0
  46. package/lib/models/command/roomRestoreShutterPositionCommand.js +6 -1
  47. package/lib/models/command/roomSetLightTimeBasedCommand.d.ts +3 -3
  48. package/lib/models/command/roomSetLightTimeBasedCommand.js +3 -3
  49. package/lib/models/command/shutterSunriseUpCommand.d.ts +5 -0
  50. package/lib/models/command/shutterSunriseUpCommand.js +5 -1
  51. package/lib/models/command/shutterSunsetDownCommand.d.ts +5 -0
  52. package/lib/models/command/shutterSunsetDownCommand.js +5 -1
  53. package/lib/models/command/wledSetLightCommand.d.ts +10 -0
  54. package/lib/models/command/wledSetLightCommand.js +10 -1
  55. package/lib/models/connectionCallbacks.d.ts +4 -4
  56. package/lib/models/deviceConfig.d.ts +2 -2
  57. package/lib/models/deviceSettings/acSettings.d.ts +0 -5
  58. package/lib/models/deviceSettings/acSettings.js +0 -5
  59. package/lib/models/deviceSettings/actuatorSettings.d.ts +0 -8
  60. package/lib/models/deviceSettings/actuatorSettings.js +0 -8
  61. package/lib/models/deviceSettings/garageDoorOpenerSettings.d.ts +0 -1
  62. package/lib/models/deviceSettings/garageDoorOpenerSettings.js +0 -1
  63. package/lib/models/deviceSettings/heaterSettings.d.ts +0 -6
  64. package/lib/models/deviceSettings/heaterSettings.js +0 -6
  65. package/lib/models/deviceSettings/motionSensorSettings.d.ts +0 -1
  66. package/lib/models/deviceSettings/motionSensorSettings.js +0 -1
  67. package/lib/models/deviceSettings/shutterSettings.d.ts +0 -3
  68. package/lib/models/deviceSettings/shutterSettings.js +0 -3
  69. package/lib/models/groupSettings/heatGroupSettings.d.ts +0 -2
  70. package/lib/models/groupSettings/heatGroupSettings.js +0 -2
  71. package/lib/models/iIdHolder.d.ts +6 -0
  72. package/lib/models/objectSettings.d.ts +2 -2
  73. package/lib/models/objectSettings.js +2 -2
  74. package/lib/models/rooms/RoomBase.d.ts +2 -1
  75. package/lib/models/rooms/RoomBase.js +2 -1
  76. package/lib/models/rooms/iRoomBase.d.ts +17 -0
  77. package/lib/models/rooms/iRoomImportEnforcer.d.ts +4 -0
  78. package/lib/server/devices/Griffe.js +0 -1
  79. package/lib/server/devices/IoBrokerBaseDevice.d.ts +9 -16
  80. package/lib/server/devices/IoBrokerBaseDevice.js +9 -16
  81. package/lib/server/devices/IoBrokerDeviceInfo.d.ts +2 -2
  82. package/lib/server/devices/IoBrokerDeviceInfo.js +6 -4
  83. package/lib/server/devices/baseDeviceInterfaces/iAcDevice.d.ts +32 -0
  84. package/lib/server/devices/baseDeviceInterfaces/iActuator.d.ts +16 -0
  85. package/lib/server/devices/baseDeviceInterfaces/iBaseDevice.d.ts +25 -0
  86. package/lib/server/devices/baseDeviceInterfaces/iBatteryDevice.d.ts +10 -1
  87. package/lib/server/devices/baseDeviceInterfaces/iBluetoothDetector.d.ts +5 -5
  88. package/lib/server/devices/baseDeviceInterfaces/iButtonSwitch.d.ts +13 -0
  89. package/lib/server/devices/baseDeviceInterfaces/iCameraDevice.d.ts +10 -0
  90. package/lib/server/devices/baseDeviceInterfaces/iDimmableLamp.d.ts +9 -2
  91. package/lib/server/devices/baseDeviceInterfaces/iEnergyManager.d.ts +13 -2
  92. package/lib/server/devices/baseDeviceInterfaces/iExcessEnergyConsumer.d.ts +16 -2
  93. package/lib/server/devices/baseDeviceInterfaces/iGarageDoorOpener.d.ts +10 -0
  94. package/lib/server/devices/baseDeviceInterfaces/iHandleSensor.d.ts +12 -0
  95. package/lib/server/devices/baseDeviceInterfaces/iHeater.d.ts +12 -2
  96. package/lib/server/devices/baseDeviceInterfaces/iHumiditySensor.d.ts +7 -0
  97. package/lib/server/devices/baseDeviceInterfaces/iLamp.d.ts +4 -0
  98. package/lib/server/devices/baseDeviceInterfaces/iLedRgbCct.d.ts +5 -0
  99. package/lib/server/devices/baseDeviceInterfaces/iMotionSensor.d.ts +7 -1
  100. package/lib/server/devices/baseDeviceInterfaces/iScene.d.ts +7 -0
  101. package/lib/server/devices/baseDeviceInterfaces/iShutter.d.ts +7 -0
  102. package/lib/server/devices/baseDeviceInterfaces/iSmokeDetectorDevice.d.ts +7 -0
  103. package/lib/server/devices/baseDeviceInterfaces/iSpeaker.d.ts +25 -0
  104. package/lib/server/devices/baseDeviceInterfaces/iTemperatureSensor.d.ts +11 -0
  105. package/lib/server/devices/baseDeviceInterfaces/iTemporaryDisableAutomatic.d.ts +7 -0
  106. package/lib/server/devices/baseDeviceInterfaces/iTvDevice.d.ts +12 -0
  107. package/lib/server/devices/baseDeviceInterfaces/iVibrationSensor.d.ts +0 -1
  108. package/lib/server/devices/blueIris/cameraDevice.d.ts +2 -3
  109. package/lib/server/devices/blueIris/cameraDevice.js +2 -3
  110. package/lib/server/devices/dachs/interfaces/KeyListEntity.d.ts +0 -8
  111. package/lib/server/devices/dachs/interfaces/KeyListEntity.js +0 -8
  112. package/lib/server/devices/dachs/lib/dachsHttpClient.d.ts +1 -1
  113. package/lib/server/devices/groups/Window.d.ts +1 -0
  114. package/lib/server/devices/groups/Window.js +1 -0
  115. package/lib/server/devices/groups/heatGroup.d.ts +6 -6
  116. package/lib/server/devices/groups/heatGroup.js +6 -6
  117. package/lib/server/devices/groups/presenceGroup.d.ts +0 -1
  118. package/lib/server/devices/groups/presenceGroup.js +0 -1
  119. package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.d.ts +0 -1
  120. package/lib/server/devices/hmIPDevices/hmIpHeizgruppe.js +0 -6
  121. package/lib/server/devices/iDeviceUpdater.d.ts +11 -0
  122. package/lib/server/devices/jsObject/jsObjectEnergyManager.d.ts +1 -1
  123. package/lib/server/devices/jsObject/jsObjectEnergyManager.js +1 -1
  124. package/lib/server/devices/sharedFunctions/lampUtils.js +3 -1
  125. package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.d.ts +1 -1
  126. package/lib/server/devices/zigbee/BaseDevices/zigbeeMotionSensor.js +1 -1
  127. package/lib/server/devices/zigbee/BaseDevices/zigbeeSwitch.d.ts +1 -1
  128. package/lib/server/devices/zigbee/zigbeeAquaraVibra.d.ts +1 -1
  129. package/lib/server/devices/zigbee/zigbeeEuroHeater.d.ts +2 -3
  130. package/lib/server/devices/zigbee/zigbeeEuroHeater.js +2 -3
  131. package/lib/server/ioBroker/connection.d.ts +20 -20
  132. package/lib/server/ioBroker/connection.js +29 -21
  133. package/lib/server/ioBroker/socketIOConnectOptions.d.ts +2 -2
  134. package/lib/server/ioBroker/socketIOVisCommand.d.ts +5 -1
  135. package/lib/server/services/Sonos/polly-service.js +1 -2
  136. package/lib/server/services/Translation/res.d.ts +34 -19
  137. package/lib/server/services/Translation/res.js +34 -19
  138. package/lib/server/services/api/api-service.d.ts +72 -70
  139. package/lib/server/services/api/api-service.js +72 -70
  140. package/lib/server/services/blockAutomaticHandler.js +5 -0
  141. package/lib/server/services/dbo/iPersist.d.ts +96 -0
  142. package/lib/server/services/https-service.d.ts +3 -2
  143. package/lib/server/services/https-service.js +3 -2
  144. package/lib/server/services/log-service/log-service.d.ts +2 -2
  145. package/lib/server/services/log-service/log-service.js +2 -2
  146. package/lib/server/services/news-service.d.ts +5 -6
  147. package/lib/server/services/news-service.js +5 -6
  148. package/lib/server/services/room-service/room-service.d.ts +3 -2
  149. package/lib/server/services/room-service/room-service.js +4 -3
  150. package/lib/server/services/settings-service.d.ts +3 -2
  151. package/lib/server/services/settings-service.js +3 -2
  152. package/lib/server/services/utils/iDisposeable.d.ts +3 -0
  153. package/lib/server/services/victron/victron-device.d.ts +2 -2
  154. package/lib/server/services/victron/victron-device.js +2 -2
  155. package/lib/server/services/weather/weather-current.d.ts +0 -2
  156. package/lib/server/services/weather/weather-service.d.ts +4 -1
  157. package/lib/server/services/weather/weather-service.js +4 -0
  158. package/lib/tsconfig.tsbuildinfo +1 -1
  159. package/package.json +6 -5
@@ -6,14 +6,14 @@ 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,131 +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
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
43
48
  * @deprecated Use "API.lampSetLight" instead
44
49
  * TODO: Remove deprecated API method
45
- * @param {string} deviceId The device Id of the lamp
46
- * @param {boolean} state The desired new state
47
- * @param timeout Desired time after which this should be reverted to normal state
48
- * @returns {Error | null} In case it failed the Error containing the reason
49
50
  */
50
51
  static setLamp(deviceId: string, state: boolean, timeout?: number): Error | null;
51
52
  /**
52
53
  * 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.
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.
56
57
  */
57
58
  static lampSetLight(deviceId: string, c: LampSetLightCommand): Error | null;
58
59
  /**
59
60
  * Changes the status of a given actuator
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
60
65
  * @deprecated Use "API.actuatorSetState" instead
61
66
  * TODO: Remove deprecated API method
62
- * @param {string} deviceId The device Id of the actuator
63
- * @param {boolean} state The desired new state
64
- * @param timeout Desired time after which this should be reverted to automatic state
65
- * @returns {Error | null} In case it failed the Error containing the reason
66
67
  */
67
68
  static setActuator(deviceId: string, state: boolean, timeout?: number): Error | null;
68
69
  /**
69
70
  * Changes the status of a given actuator
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
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
73
74
  */
74
75
  static actuatorSetState(deviceId: string, c: ActuatorSetStateCommand): Error | null;
75
76
  /**
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
77
84
  * @deprecated Use "API.dimmerSetLight" instead
78
85
  * TODO: Remove deprecated API method
79
- * @param {string} deviceId The device Id of the actuator
80
- * @param {boolean} state The desired new state
81
- * @param timeout A chosen Timeout after which the light should be reset
82
- * @param brightness The desired brightness
83
- * @param transitionTime The transition time during turnOn/turnOff
84
- * @returns {Error | null} In case it failed the Error containing the reason
85
86
  */
86
87
  static setDimmer(deviceId: string, state: boolean, timeout?: number, brightness?: number, transitionTime?: number): Error | null;
87
88
  /**
88
89
  * 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.
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.
92
93
  */
93
94
  static dimmerSetLight(deviceId: string, command: DimmerSetLightCommand): Error | null;
94
95
  /**
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
96
105
  * @deprecated Use "API.ledSetLight" instead
97
106
  * TODO: Remove deprecated API method
98
- * @param {string} deviceId The device Id of the actuator
99
- * @param {boolean} state The desired new state
100
- * @param timeout A chosen Timeout after which the light should be reset
101
- * @param brightness The desired brightness
102
- * @param transitionTime The transition time during turnOn/turnOff
103
- * @param {string} color The desired color in 6 digit hex Code
104
- * @param {number} colorTemp The desired color Temperature (0 = more White)
105
- * @returns {Error | null} In case it failed the Error containing the reason
106
107
  */
107
108
  static setLedLamp(deviceId: string, state: boolean, timeout?: number, brightness?: number, transitionTime?: number, color?: string, colorTemp?: number): Error | null;
108
109
  /**
109
110
  * 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
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
112
114
  */
113
115
  static ledSetLight(deviceId: string, command: LedSetLightCommand): Error | null;
114
116
  /**
115
117
  * Changes the position of a given shutter
116
118
  * if needed this updates the window position as well
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
117
122
  * @deprecated Use "API.shutterSetLevel" instead
118
123
  * TODO: Remove deprecated API method
119
- * @param {string} deviceId The device Id of the shutter
120
- * @param {number} level The desired new level (0 being open, 100 being closed)
121
- * @returns {Error | null} Error if there is no shutter with the given id
122
124
  */
123
125
  static setShutter(deviceId: string, level: number): Error | null;
124
126
  /**
125
127
  * Changes the position of a given shutter
126
128
  * 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
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
130
132
  */
131
133
  static shutterSetLevel(deviceId: string, command: ShutterSetLevelCommand): Error | null;
132
134
  static speakOnDevice(deviceId: string, message: string, volume?: number): Error | null;
133
135
  /**
134
136
  * Starts a specified scene
135
- * @param {string} deviceId The targeted scene
136
- * @param {number} turnOffTimeout If provided the time in ms after which the scene should end automatically
137
- * @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
138
140
  */
139
141
  static startScene(deviceId: string, turnOffTimeout?: number): Error | null;
140
142
  static switchGarageDoor(deviceId: string, open: boolean): Error | null;
141
143
  /**
142
144
  * Changes the settings of a given device
143
- * @param {string} deviceId The id of the device to change the settings
144
- * @param settings A partial settings object containing the wanted settings properties
145
- * @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
146
148
  */
147
149
  static setDeviceSettings(deviceId: string, settings: Partial<DeviceSettings>): Error | null;
148
150
  static setGroupSettings(groupId: string, settings: Partial<GroupSettings>): Error | null;
149
151
  /**
150
152
  * Changes the settings of a given room
151
- * @param {string} roomName The id of the Room to change the settings
152
- * @param settings A partial settings object containing the wanted settings properties
153
- * @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
154
156
  */
155
157
  static setRoomSettings(roomName: string, settings: Partial<DeviceSettings>): Error | null;
156
158
  static getLastCameraImage(deviceId: string): Error | string;
@@ -158,34 +160,34 @@ export declare class API {
158
160
  static loadAllDeviceSettingsFromDb(): void;
159
161
  /**
160
162
  * Lifts a previously started Block of automatic
163
+ * @param deviceId - The target device
164
+ * @returns In case it failed the Error containing the reason
161
165
  * @deprecated Use "API.blockAutomaticLiftAutomaticBlock" instead
162
166
  * TODO: Remove deprecated API method
163
- * @param {string} deviceId The target device
164
- * @returns {Error | null} In case it failed the Error containing the reason
165
167
  */
166
168
  static liftAutomaticBlock(deviceId: string): Error | null;
167
169
  /**
168
170
  * 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
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
172
174
  */
173
175
  static blockAutomaticLiftAutomaticBlock(deviceId: string, command: BlockAutomaticLiftBlockCommand): Error | null;
174
176
  /**
175
177
  * Blocks the automatic of the given device for provided Duration
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
176
182
  * @deprecated Use "API.blockAutomaticDisable" instead
177
183
  * TODO: Remove deprecated API method
178
- * @param {string} deviceId The target device
179
- * @param {number} duration The duration in ms for which the device should remain in current state
180
- * @param {CollisionSolving} onCollision The desired Collision Solving strategy, in case the automatic being blocked already
181
- * @returns {Error | null} In case it failed the Error containing the reason
182
184
  */
183
185
  static blockAutomatic(deviceId: string, duration: number, onCollision?: CollisionSolving): Error | null;
184
186
  /**
185
187
  * 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
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
189
191
  */
190
192
  static blockAutomaticSetBlock(deviceId: string, command: BlockAutomaticCommand): Error | null;
191
193
  static pressButtonSwitch(deviceId: string, position: ButtonPosition, pressType: ButtonPressType): Error | null;
@@ -12,8 +12,8 @@ const config_1 = require("../../config");
12
12
  class API {
13
13
  /**
14
14
  * Endpoint to end a scene manually (or early if it has automatic turn off)
15
- * @param {string} deviceId
16
- * @returns {Error | null}
15
+ * @param deviceId - The id of the scene to end
16
+ * @returns In case it failed the Error containing the reason
17
17
  */
18
18
  static endScene(deviceId) {
19
19
  const d = this.getDevice(deviceId);
@@ -29,8 +29,8 @@ class API {
29
29
  }
30
30
  /**
31
31
  * Gets the instance of an Ac Device identified by id
32
- * @param {string} id
33
- * @returns {OwnDaikinDevice | undefined}
32
+ * @param id - The device id of the AC
33
+ * @returns The instance of the AC Device or undefined if not found
34
34
  */
35
35
  static getAc(id) {
36
36
  const result = this.getDevice(id);
@@ -75,11 +75,12 @@ class API {
75
75
  }
76
76
  /**
77
77
  * Turns on/off one AC identified by it's id
78
- * @param id The id of the device, if wrong false will be returned
79
- * @param {boolean} desiredState
80
- * @param {AcMode} desiredMode
81
- * @param desiredTemperature
82
- * @param forceTime The time in ms this should not change before automatic change is allowed again
78
+ * @param id - The id of the device, if wrong false will be returned
79
+ * @param desiredState - The desired state for the AC
80
+ * @param desiredMode - The desired mode for the AC
81
+ * @param desiredTemperature - The desired temperature for the AC in Celsius
82
+ * @param forceTime - The time in ms this should not change before automatic change is allowed again
83
+ * @returns True if the AC was found and the state was changed
83
84
  */
84
85
  static setAc(id, desiredState, desiredMode, desiredTemperature, forceTime = 60 * 60 * 1000) {
85
86
  const d = this.getAc(id);
@@ -105,7 +106,7 @@ class API {
105
106
  }
106
107
  /**
107
108
  * Turns on/off all AC´s in the home
108
- * @param {boolean} desiredState
109
+ * @param desiredState - The desired state for all AC´s
109
110
  */
110
111
  static setAllAc(desiredState) {
111
112
  ac_1.DaikinService.setAll(desiredState, true);
@@ -113,21 +114,21 @@ class API {
113
114
  }
114
115
  /**
115
116
  * Changes the status of a given Lamp
117
+ * @param deviceId - The device Id of the lamp
118
+ * @param state - The desired new state
119
+ * @param timeout - Desired time after which this should be reverted to normal state
120
+ * @returns In case it failed the Error containing the reason
116
121
  * @deprecated Use "API.lampSetLight" instead
117
122
  * TODO: Remove deprecated API method
118
- * @param {string} deviceId The device Id of the lamp
119
- * @param {boolean} state The desired new state
120
- * @param timeout Desired time after which this should be reverted to normal state
121
- * @returns {Error | null} In case it failed the Error containing the reason
122
123
  */
123
124
  static setLamp(deviceId, state, timeout = 60 * 60 * 1000) {
124
125
  return this.lampSetLight(deviceId, new models_1.LampSetLightCommand(models_1.CommandSource.API, state, '', timeout));
125
126
  }
126
127
  /**
127
128
  * Changes the status of a given Lamp
128
- * @param {string} deviceId The device Id of the lamp
129
- * @param {LampSetLightCommand} c The command(stack) to perform on the lamp
130
- * @returns {Error | null} In case it failed the Error containing the reason.
129
+ * @param deviceId - The device Id of the lamp
130
+ * @param c - The command(stack) to perform on the lamp
131
+ * @returns In case it failed the Error containing the reason.
131
132
  */
132
133
  static lampSetLight(deviceId, c) {
133
134
  const d = this.getDevice(deviceId);
@@ -143,21 +144,21 @@ class API {
143
144
  }
144
145
  /**
145
146
  * Changes the status of a given actuator
147
+ * @param deviceId - The device Id of the actuator
148
+ * @param state - The desired new state
149
+ * @param timeout - Desired time after which this should be reverted to automatic state
150
+ * @returns In case it failed the Error containing the reason
146
151
  * @deprecated Use "API.actuatorSetState" instead
147
152
  * TODO: Remove deprecated API method
148
- * @param {string} deviceId The device Id of the actuator
149
- * @param {boolean} state The desired new state
150
- * @param timeout Desired time after which this should be reverted to automatic state
151
- * @returns {Error | null} In case it failed the Error containing the reason
152
153
  */
153
154
  static setActuator(deviceId, state, timeout = 60 * 60 * 1000) {
154
155
  return this.actuatorSetState(deviceId, new models_1.ActuatorSetStateCommand(models_1.CommandSource.API, state, '', timeout));
155
156
  }
156
157
  /**
157
158
  * Changes the status of a given actuator
158
- * @param {string} deviceId The device Id of the actuator
159
- * @param {ActuatorSetStateCommand} c The command(stack) to perform on the actuator
160
- * @returns {Error | null} In case it failed the Error containing the reason
159
+ * @param deviceId - The device Id of the actuator
160
+ * @param c - The command(stack) to perform on the actuator
161
+ * @returns In case it failed the Error containing the reason
161
162
  */
162
163
  static actuatorSetState(deviceId, c) {
163
164
  const d = this.getDevice(deviceId);
@@ -173,23 +174,23 @@ class API {
173
174
  }
174
175
  /**
175
176
  * Changes the status of the given dimmer
177
+ * @param deviceId - The device Id of the actuator
178
+ * @param state - The desired new state
179
+ * @param timeout - A chosen Timeout after which the light should be reset
180
+ * @param brightness - The desired brightness
181
+ * @param transitionTime - The transition time during turnOn/turnOff
182
+ * @returns In case it failed the Error containing the reason
176
183
  * @deprecated Use "API.dimmerSetLight" instead
177
184
  * TODO: Remove deprecated API method
178
- * @param {string} deviceId The device Id of the actuator
179
- * @param {boolean} state The desired new state
180
- * @param timeout A chosen Timeout after which the light should be reset
181
- * @param brightness The desired brightness
182
- * @param transitionTime The transition time during turnOn/turnOff
183
- * @returns {Error | null} In case it failed the Error containing the reason
184
185
  */
185
186
  static setDimmer(deviceId, state, timeout, brightness, transitionTime) {
186
187
  return this.dimmerSetLight(deviceId, new models_1.DimmerSetLightCommand(models_1.CommandSource.API, state, '', timeout, brightness, transitionTime));
187
188
  }
188
189
  /**
189
190
  * Changes the status of the given dimmer
190
- * @param {string} deviceId The device Id of the dimmable device.
191
- * @param {DimmerSetLightCommand} command The command(stack) to perform on the dimmer
192
- * @returns {Error | null} In case it failed the Error containing the reason.
191
+ * @param deviceId - The device Id of the dimmable device.
192
+ * @param command - The command(stack) to perform on the dimmer
193
+ * @returns In case it failed the Error containing the reason.
193
194
  */
194
195
  static dimmerSetLight(deviceId, command) {
195
196
  const d = this.getDevice(deviceId);
@@ -205,24 +206,25 @@ class API {
205
206
  }
206
207
  /**
207
208
  * Changes the status of a given led-device
209
+ * @param deviceId - The device Id of the actuator
210
+ * @param state - The desired new state
211
+ * @param timeout - A chosen Timeout after which the light should be reset
212
+ * @param brightness - The desired brightness
213
+ * @param transitionTime - The transition time during turnOn/turnOff
214
+ * @param color - The desired color in 6 digit hex Code
215
+ * @param colorTemp - The desired color Temperature (0 = more White)
216
+ * @returns In case it failed the Error containing the reason
208
217
  * @deprecated Use "API.ledSetLight" instead
209
218
  * TODO: Remove deprecated API method
210
- * @param {string} deviceId The device Id of the actuator
211
- * @param {boolean} state The desired new state
212
- * @param timeout A chosen Timeout after which the light should be reset
213
- * @param brightness The desired brightness
214
- * @param transitionTime The transition time during turnOn/turnOff
215
- * @param {string} color The desired color in 6 digit hex Code
216
- * @param {number} colorTemp The desired color Temperature (0 = more White)
217
- * @returns {Error | null} In case it failed the Error containing the reason
218
219
  */
219
220
  static setLedLamp(deviceId, state, timeout, brightness, transitionTime, color, colorTemp) {
220
221
  return this.ledSetLight(deviceId, new models_1.LedSetLightCommand(models_1.CommandSource.API, state, '', timeout, brightness, transitionTime, color, colorTemp));
221
222
  }
222
223
  /**
223
224
  * Changes the status of a given led-device
224
- * @param {string} deviceId The device Id of the LED-Device
225
- * @param {LedSetLightCommand} command The command(stack) to perform on the led-device
225
+ * @param deviceId - The device Id of the LED-Device
226
+ * @param command - The command(stack) to perform on the led-device
227
+ * @returns In case it failed the Error containing the reason
226
228
  */
227
229
  static ledSetLight(deviceId, command) {
228
230
  const d = this.getDevice(deviceId);
@@ -239,11 +241,11 @@ class API {
239
241
  /**
240
242
  * Changes the position of a given shutter
241
243
  * if needed this updates the window position as well
244
+ * @param deviceId - The device Id of the shutter
245
+ * @param level - The desired new level (0 being open, 100 being closed)
246
+ * @returns Error if there is no shutter with the given id
242
247
  * @deprecated Use "API.shutterSetLevel" instead
243
248
  * TODO: Remove deprecated API method
244
- * @param {string} deviceId The device Id of the shutter
245
- * @param {number} level The desired new level (0 being open, 100 being closed)
246
- * @returns {Error | null} Error if there is no shutter with the given id
247
249
  */
248
250
  static setShutter(deviceId, level) {
249
251
  return this.shutterSetLevel(deviceId, new models_1.ShutterSetLevelCommand(models_1.CommandSource.API, level));
@@ -251,9 +253,9 @@ class API {
251
253
  /**
252
254
  * Changes the position of a given shutter
253
255
  * if needed this updates the window position as well
254
- * @param {string} deviceId The device Id of the shutter
255
- * @param {ShutterSetLevelCommand} command The command(stack) to perform on the shutter
256
- * @returns {Error | null} Error if there is no shutter with the given id
256
+ * @param deviceId - The device Id of the shutter
257
+ * @param command - The command(stack) to perform on the shutter
258
+ * @returns Error if there is no shutter with the given id
257
259
  */
258
260
  static shutterSetLevel(deviceId, command) {
259
261
  const d = this.getDevice(deviceId);
@@ -288,9 +290,9 @@ class API {
288
290
  }
289
291
  /**
290
292
  * Starts a specified scene
291
- * @param {string} deviceId The targeted scene
292
- * @param {number} turnOffTimeout If provided the time in ms after which the scene should end automatically
293
- * @returns {Error | null} In case it failed the Error containing the reason
293
+ * @param deviceId - The targeted scene
294
+ * @param turnOffTimeout - If provided the time in ms after which the scene should end automatically
295
+ * @returns In case it failed the Error containing the reason
294
296
  */
295
297
  static startScene(deviceId, turnOffTimeout) {
296
298
  const d = this.getDevice(deviceId);
@@ -324,9 +326,9 @@ class API {
324
326
  }
325
327
  /**
326
328
  * Changes the settings of a given device
327
- * @param {string} deviceId The id of the device to change the settings
328
- * @param settings A partial settings object containing the wanted settings properties
329
- * @returns {Error | null} In case it failed the Error containing the reason
329
+ * @param deviceId - The id of the device to change the settings
330
+ * @param settings - A partial settings object containing the wanted settings properties
331
+ * @returns In case it failed the Error containing the reason
330
332
  */
331
333
  static setDeviceSettings(deviceId, settings) {
332
334
  const d = this.getDevice(deviceId);
@@ -357,9 +359,9 @@ class API {
357
359
  }
358
360
  /**
359
361
  * Changes the settings of a given room
360
- * @param {string} roomName The id of the Room to change the settings
361
- * @param settings A partial settings object containing the wanted settings properties
362
- * @returns {Error | null} In case it failed the Error containing the reason
362
+ * @param roomName - The id of the Room to change the settings
363
+ * @param settings - A partial settings object containing the wanted settings properties
364
+ * @returns In case it failed the Error containing the reason
363
365
  */
364
366
  static setRoomSettings(roomName, settings) {
365
367
  const r = this.getRoom(roomName);
@@ -399,19 +401,19 @@ class API {
399
401
  }
400
402
  /**
401
403
  * Lifts a previously started Block of automatic
404
+ * @param deviceId - The target device
405
+ * @returns In case it failed the Error containing the reason
402
406
  * @deprecated Use "API.blockAutomaticLiftAutomaticBlock" instead
403
407
  * TODO: Remove deprecated API method
404
- * @param {string} deviceId The target device
405
- * @returns {Error | null} In case it failed the Error containing the reason
406
408
  */
407
409
  static liftAutomaticBlock(deviceId) {
408
410
  return this.blockAutomaticLiftAutomaticBlock(deviceId, new models_1.BlockAutomaticLiftBlockCommand(models_1.CommandSource.API));
409
411
  }
410
412
  /**
411
413
  * Lifts a previously started Block of automatic
412
- * @param {string} deviceId The target device
413
- * @param {BlockAutomaticLiftBlockCommand} command The command to lift the automatic block
414
- * @returns {Error | null} In case it failed the Error containing the reason
414
+ * @param deviceId - The target device
415
+ * @param command - The command to lift the automatic block
416
+ * @returns In case it failed the Error containing the reason
415
417
  */
416
418
  static blockAutomaticLiftAutomaticBlock(deviceId, command) {
417
419
  const d = this.getDevice(deviceId);
@@ -427,12 +429,12 @@ class API {
427
429
  }
428
430
  /**
429
431
  * Blocks the automatic of the given device for provided Duration
432
+ * @param deviceId - The target device
433
+ * @param duration - The duration in ms for which the device should remain in current state
434
+ * @param onCollision - The desired Collision Solving strategy, in case the automatic being blocked already
435
+ * @returns In case it failed the Error containing the reason
430
436
  * @deprecated Use "API.blockAutomaticDisable" instead
431
437
  * TODO: Remove deprecated API method
432
- * @param {string} deviceId The target device
433
- * @param {number} duration The duration in ms for which the device should remain in current state
434
- * @param {CollisionSolving} onCollision The desired Collision Solving strategy, in case the automatic being blocked already
435
- * @returns {Error | null} In case it failed the Error containing the reason
436
438
  */
437
439
  static blockAutomatic(deviceId, duration, onCollision) {
438
440
  this.blockAutomaticSetBlock(deviceId, new models_1.BlockAutomaticCommand(models_1.CommandSource.API, duration, '', onCollision));
@@ -440,9 +442,9 @@ class API {
440
442
  }
441
443
  /**
442
444
  * Blocks the automatic of the given device for provided Duration
443
- * @param {string} deviceId The target device
444
- * @param {BlockAutomaticCommand} command The command to block the automatic
445
- * @returns {Error | null} In case it failed the Error containing the reason
445
+ * @param deviceId - The target device
446
+ * @param command - The command to block the automatic
447
+ * @returns In case it failed the Error containing the reason
446
448
  */
447
449
  static blockAutomaticSetBlock(deviceId, command) {
448
450
  const d = this.getDevice(deviceId);
@@ -36,6 +36,11 @@ class BlockAutomaticHandler {
36
36
  this.updateRestoreTimeout(new models_1.RestoreTargetAutomaticValueCommand(c, 'Restore to automatic state after block.'));
37
37
  }
38
38
  liftAutomaticBlock(c) {
39
+ if (this._restoreAutomaticStateTimeout !== null) {
40
+ clearTimeout(this._restoreAutomaticStateTimeout);
41
+ }
42
+ this._restoreAutomaticStateTimeout = null;
43
+ this.automaticBlockedUntil = new Date(0);
39
44
  this._restoreAutomatic(new models_1.RestoreTargetAutomaticValueCommand(c));
40
45
  }
41
46
  updateRestoreTimeout(c) {