iobroker.iot 3.6.0 → 4.0.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.
Files changed (254) hide show
  1. package/README.md +8 -4
  2. package/admin/assets/index-5zouxn2w.js +680 -0
  3. package/admin/index_m.html +1 -1
  4. package/admin/rules/assets/{index-BRdNnGcA.js → index-DwYdaT5M.js} +80 -81
  5. package/admin/rules/customRuleBlocks.js +2 -2
  6. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/AlexaResponse.js +101 -95
  7. package/build-backend/lib/AlexaSmartHomeV3/Alexa/AlexaResponse.js.map +1 -0
  8. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Capabilities/Base.js +22 -36
  9. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/Base.js.map +1 -0
  10. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/BrightnessController.js +19 -0
  11. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/BrightnessController.js.map +1 -0
  12. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorController.js +14 -0
  13. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorController.js.map +1 -0
  14. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorTemperatureController.js +19 -0
  15. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorTemperatureController.js.map +1 -0
  16. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ContactSensor.js +16 -0
  17. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ContactSensor.js.map +1 -0
  18. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/LockController.js +14 -0
  19. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/LockController.js.map +1 -0
  20. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Capabilities/ModeController.js +27 -28
  21. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ModeController.js.map +1 -0
  22. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/MotionSensor.js +14 -0
  23. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/MotionSensor.js.map +1 -0
  24. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/PercentageController.js +14 -0
  25. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/PercentageController.js.map +1 -0
  26. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/PowerController.js +19 -0
  27. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/PowerController.js.map +1 -0
  28. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/Speaker.js +25 -0
  29. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/Speaker.js.map +1 -0
  30. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/TemperatureSensor.js +14 -0
  31. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/TemperatureSensor.js.map +1 -0
  32. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ThermostatController.js +37 -0
  33. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/ThermostatController.js.map +1 -0
  34. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/index.js +32 -0
  35. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Capabilities/index.js.map +1 -0
  36. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/Base.js +29 -0
  37. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/Base.js.map +1 -0
  38. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Directives/ChangeReport.js +34 -27
  39. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/ChangeReport.js.map +1 -0
  40. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/Discovery.js +39 -0
  41. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/Discovery.js.map +1 -0
  42. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Directives/ReportState.js +19 -22
  43. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/ReportState.js.map +1 -0
  44. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/index.js +14 -0
  45. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Directives/index.js.map +1 -0
  46. package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/Base.js +36 -0
  47. package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/Base.js.map +1 -0
  48. package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/Closed.js +57 -0
  49. package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/Closed.js.map +1 -0
  50. package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/Open.js +57 -0
  51. package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/Open.js.map +1 -0
  52. package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/index.js +12 -0
  53. package/build-backend/lib/AlexaSmartHomeV3/Alexa/ModeValues/index.js.map +1 -0
  54. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/AdjustableProperty.js +16 -0
  55. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/AdjustableProperty.js.map +1 -0
  56. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Base.js +127 -0
  57. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Base.js.map +1 -0
  58. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Brightness.js +18 -0
  59. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Brightness.js.map +1 -0
  60. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Color.js +38 -0
  61. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Color.js.map +1 -0
  62. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Properties/ColorTemperatureInKelvin.js +20 -29
  63. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/ColorTemperatureInKelvin.js.map +1 -0
  64. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/DetectionState.js +23 -0
  65. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/DetectionState.js.map +1 -0
  66. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Properties/LockState.js +9 -12
  67. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/LockState.js.map +1 -0
  68. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Mode.js +34 -0
  69. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Mode.js.map +1 -0
  70. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Muted.js +19 -0
  71. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Muted.js.map +1 -0
  72. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Percentage.js +18 -0
  73. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Percentage.js.map +1 -0
  74. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Alexa/Properties/PowerState.js +9 -9
  75. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/PowerState.js.map +1 -0
  76. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/TargetSetpoint.js +31 -0
  77. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/TargetSetpoint.js.map +1 -0
  78. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Temperature.js +22 -0
  79. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Temperature.js.map +1 -0
  80. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/ThermostatMode.js +49 -0
  81. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/ThermostatMode.js.map +1 -0
  82. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Volume.js +21 -0
  83. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/Volume.js.map +1 -0
  84. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/index.js +38 -0
  85. package/build-backend/lib/AlexaSmartHomeV3/Alexa/Properties/index.js.map +1 -0
  86. package/build-backend/lib/AlexaSmartHomeV3/Controls/AdjustableControl.js +20 -0
  87. package/build-backend/lib/AlexaSmartHomeV3/Controls/AdjustableControl.js.map +1 -0
  88. package/build-backend/lib/AlexaSmartHomeV3/Controls/AdjustablePercentageControl.js +26 -0
  89. package/build-backend/lib/AlexaSmartHomeV3/Controls/AdjustablePercentageControl.js.map +1 -0
  90. package/build-backend/lib/AlexaSmartHomeV3/Controls/AirCondition.js +148 -0
  91. package/build-backend/lib/AlexaSmartHomeV3/Controls/AirCondition.js.map +1 -0
  92. package/build-backend/lib/AlexaSmartHomeV3/Controls/Blind.js +13 -0
  93. package/build-backend/lib/AlexaSmartHomeV3/Controls/Blind.js.map +1 -0
  94. package/build-backend/lib/AlexaSmartHomeV3/Controls/ContactSensor.js +17 -0
  95. package/build-backend/lib/AlexaSmartHomeV3/Controls/ContactSensor.js.map +1 -0
  96. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Controls/Control.js +73 -104
  97. package/build-backend/lib/AlexaSmartHomeV3/Controls/Control.js.map +1 -0
  98. package/build-backend/lib/AlexaSmartHomeV3/Controls/Ct.js +182 -0
  99. package/build-backend/lib/AlexaSmartHomeV3/Controls/Ct.js.map +1 -0
  100. package/build-backend/lib/AlexaSmartHomeV3/Controls/Dimmer.js +127 -0
  101. package/build-backend/lib/AlexaSmartHomeV3/Controls/Dimmer.js.map +1 -0
  102. package/build-backend/lib/AlexaSmartHomeV3/Controls/Door.js +10 -0
  103. package/build-backend/lib/AlexaSmartHomeV3/Controls/Door.js.map +1 -0
  104. package/build-backend/lib/AlexaSmartHomeV3/Controls/Gate.js +38 -0
  105. package/build-backend/lib/AlexaSmartHomeV3/Controls/Gate.js.map +1 -0
  106. package/build-backend/lib/AlexaSmartHomeV3/Controls/Hue.js +208 -0
  107. package/build-backend/lib/AlexaSmartHomeV3/Controls/Hue.js.map +1 -0
  108. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Controls/Light.js +15 -22
  109. package/build-backend/lib/AlexaSmartHomeV3/Controls/Light.js.map +1 -0
  110. package/build-backend/lib/AlexaSmartHomeV3/Controls/Lock.js +35 -0
  111. package/build-backend/lib/AlexaSmartHomeV3/Controls/Lock.js.map +1 -0
  112. package/build-backend/lib/AlexaSmartHomeV3/Controls/Motion.js +17 -0
  113. package/build-backend/lib/AlexaSmartHomeV3/Controls/Motion.js.map +1 -0
  114. package/build-backend/lib/AlexaSmartHomeV3/Controls/ReadOnlyDetector.js +26 -0
  115. package/build-backend/lib/AlexaSmartHomeV3/Controls/ReadOnlyDetector.js.map +1 -0
  116. package/build-backend/lib/AlexaSmartHomeV3/Controls/Slider.js +10 -0
  117. package/build-backend/lib/AlexaSmartHomeV3/Controls/Slider.js.map +1 -0
  118. package/build-backend/lib/AlexaSmartHomeV3/Controls/Socket.js +21 -0
  119. package/build-backend/lib/AlexaSmartHomeV3/Controls/Socket.js.map +1 -0
  120. package/build-backend/lib/AlexaSmartHomeV3/Controls/Temperature.js +21 -0
  121. package/build-backend/lib/AlexaSmartHomeV3/Controls/Temperature.js.map +1 -0
  122. package/build-backend/lib/AlexaSmartHomeV3/Controls/Thermostat.js +85 -0
  123. package/build-backend/lib/AlexaSmartHomeV3/Controls/Thermostat.js.map +1 -0
  124. package/build-backend/lib/AlexaSmartHomeV3/Controls/VacuumCleaner.js +27 -0
  125. package/build-backend/lib/AlexaSmartHomeV3/Controls/VacuumCleaner.js.map +1 -0
  126. package/build-backend/lib/AlexaSmartHomeV3/Controls/Volume.js +116 -0
  127. package/build-backend/lib/AlexaSmartHomeV3/Controls/Volume.js.map +1 -0
  128. package/build-backend/lib/AlexaSmartHomeV3/Controls/VolumeGroup.js +10 -0
  129. package/build-backend/lib/AlexaSmartHomeV3/Controls/VolumeGroup.js.map +1 -0
  130. package/build-backend/lib/AlexaSmartHomeV3/Controls/Window.js +10 -0
  131. package/build-backend/lib/AlexaSmartHomeV3/Controls/Window.js.map +1 -0
  132. package/build-backend/lib/AlexaSmartHomeV3/Controls/index.js +121 -0
  133. package/build-backend/lib/AlexaSmartHomeV3/Controls/index.js.map +1 -0
  134. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Device.js +29 -30
  135. package/build-backend/lib/AlexaSmartHomeV3/Device.js.map +1 -0
  136. package/build-backend/lib/AlexaSmartHomeV3/DeviceManager.js +392 -0
  137. package/build-backend/lib/AlexaSmartHomeV3/DeviceManager.js.map +1 -0
  138. package/build-backend/lib/AlexaSmartHomeV3/Exceptions/AlexaV3Exception.js +10 -0
  139. package/build-backend/lib/AlexaSmartHomeV3/Exceptions/AlexaV3Exception.js.map +1 -0
  140. package/build-backend/lib/AlexaSmartHomeV3/Exceptions/HourlyDeviceRateLimitExceeded.js +10 -0
  141. package/build-backend/lib/AlexaSmartHomeV3/Exceptions/HourlyDeviceRateLimitExceeded.js.map +1 -0
  142. package/build-backend/lib/AlexaSmartHomeV3/Exceptions/OverallDailyRateLimitExceeded.js +10 -0
  143. package/build-backend/lib/AlexaSmartHomeV3/Exceptions/OverallDailyRateLimitExceeded.js.map +1 -0
  144. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Helpers/AdapterProvider.js +12 -21
  145. package/build-backend/lib/AlexaSmartHomeV3/Helpers/AdapterProvider.js.map +1 -0
  146. package/build-backend/lib/AlexaSmartHomeV3/Helpers/FileHelper.js +53 -0
  147. package/build-backend/lib/AlexaSmartHomeV3/Helpers/FileHelper.js.map +1 -0
  148. package/{lib → build-backend/lib}/AlexaSmartHomeV3/Helpers/IotProxy.js +9 -26
  149. package/build-backend/lib/AlexaSmartHomeV3/Helpers/IotProxy.js.map +1 -0
  150. package/build-backend/lib/AlexaSmartHomeV3/Helpers/Logger.js +93 -0
  151. package/build-backend/lib/AlexaSmartHomeV3/Helpers/Logger.js.map +1 -0
  152. package/build-backend/lib/AlexaSmartHomeV3/Helpers/RateLimiter.js +112 -0
  153. package/build-backend/lib/AlexaSmartHomeV3/Helpers/RateLimiter.js.map +1 -0
  154. package/build-backend/lib/AlexaSmartHomeV3/Helpers/Utils.js +625 -0
  155. package/build-backend/lib/AlexaSmartHomeV3/Helpers/Utils.js.map +1 -0
  156. package/build-backend/lib/Utils.js +96 -0
  157. package/build-backend/lib/Utils.js.map +1 -0
  158. package/build-backend/lib/adminCommonSocket.js +715 -0
  159. package/build-backend/lib/adminCommonSocket.js.map +1 -0
  160. package/build-backend/lib/alexaCustom.js +542 -0
  161. package/build-backend/lib/alexaCustom.js.map +1 -0
  162. package/{lib → build-backend/lib}/alexaSmartHomeV2.js +4 -8
  163. package/{lib → build-backend/lib}/alexaSmartHomeV3.js +25 -45
  164. package/build-backend/lib/alexaSmartHomeV3.js.map +1 -0
  165. package/{lib → build-backend/lib}/alisa.js +41 -44
  166. package/{lib → build-backend/lib}/devices.js +11 -8
  167. package/build-backend/lib/devices.js.map +1 -0
  168. package/{lib → build-backend/lib}/functions.js +11 -8
  169. package/build-backend/lib/functions.js.map +1 -0
  170. package/{lib → build-backend/lib}/googleHome.js +25 -26
  171. package/{lib → build-backend/lib}/notifications.js +15 -22
  172. package/build-backend/lib/notifications.js.map +1 -0
  173. package/{lib → build-backend/lib}/remote.js +615 -636
  174. package/build-backend/lib/remote.js.map +1 -0
  175. package/{lib → build-backend/lib}/rooms.js +11 -8
  176. package/build-backend/lib/rooms.js.map +1 -0
  177. package/{lib → build-backend/lib}/texts.js +6 -4
  178. package/build-backend/lib/texts.js.map +1 -0
  179. package/build-backend/lib/translate.js +21 -0
  180. package/build-backend/lib/translate.js.map +1 -0
  181. package/{lib → build-backend/lib}/visuApp.js +45 -65
  182. package/build-backend/lib/visuApp.js.map +1 -0
  183. package/build-backend/main.js +1361 -0
  184. package/build-backend/main.js.map +1 -0
  185. package/io-package.json +14 -14
  186. package/package.json +18 -15
  187. package/admin/assets/index-DCbOB3g_.js +0 -681
  188. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/BrightnessController.js +0 -15
  189. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorController.js +0 -10
  190. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ColorTemperatureController.js +0 -15
  191. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ContactSensor.js +0 -10
  192. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/LockController.js +0 -10
  193. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/MotionSensor.js +0 -10
  194. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/PercentageController.js +0 -10
  195. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/PowerController.js +0 -15
  196. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/Speaker.js +0 -20
  197. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/TemperatureSensor.js +0 -10
  198. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/ThermostatController.js +0 -34
  199. package/lib/AlexaSmartHomeV3/Alexa/Capabilities/index.js +0 -14
  200. package/lib/AlexaSmartHomeV3/Alexa/Directives/Base.js +0 -27
  201. package/lib/AlexaSmartHomeV3/Alexa/Directives/Discovery.js +0 -39
  202. package/lib/AlexaSmartHomeV3/Alexa/Directives/index.js +0 -13
  203. package/lib/AlexaSmartHomeV3/Alexa/ModeValues/Base.js +0 -38
  204. package/lib/AlexaSmartHomeV3/Alexa/ModeValues/Closed.js +0 -55
  205. package/lib/AlexaSmartHomeV3/Alexa/ModeValues/Open.js +0 -56
  206. package/lib/AlexaSmartHomeV3/Alexa/ModeValues/index.js +0 -14
  207. package/lib/AlexaSmartHomeV3/Alexa/Properties/AdjustableProperty.js +0 -11
  208. package/lib/AlexaSmartHomeV3/Alexa/Properties/Base.js +0 -108
  209. package/lib/AlexaSmartHomeV3/Alexa/Properties/Brightness.js +0 -14
  210. package/lib/AlexaSmartHomeV3/Alexa/Properties/Color.js +0 -40
  211. package/lib/AlexaSmartHomeV3/Alexa/Properties/DetectionState.js +0 -22
  212. package/lib/AlexaSmartHomeV3/Alexa/Properties/Mode.js +0 -32
  213. package/lib/AlexaSmartHomeV3/Alexa/Properties/Muted.js +0 -17
  214. package/lib/AlexaSmartHomeV3/Alexa/Properties/Percentage.js +0 -14
  215. package/lib/AlexaSmartHomeV3/Alexa/Properties/TargetSetpoint.js +0 -28
  216. package/lib/AlexaSmartHomeV3/Alexa/Properties/Temperature.js +0 -20
  217. package/lib/AlexaSmartHomeV3/Alexa/Properties/ThermostatMode.js +0 -52
  218. package/lib/AlexaSmartHomeV3/Alexa/Properties/Volume.js +0 -19
  219. package/lib/AlexaSmartHomeV3/Alexa/Properties/index.js +0 -14
  220. package/lib/AlexaSmartHomeV3/Controls/AdjustableControl.js +0 -22
  221. package/lib/AlexaSmartHomeV3/Controls/AdjustablePercentageControl.js +0 -28
  222. package/lib/AlexaSmartHomeV3/Controls/AirCondition.js +0 -144
  223. package/lib/AlexaSmartHomeV3/Controls/Blind.js +0 -12
  224. package/lib/AlexaSmartHomeV3/Controls/ContactSensor.js +0 -17
  225. package/lib/AlexaSmartHomeV3/Controls/Ct.js +0 -172
  226. package/lib/AlexaSmartHomeV3/Controls/Dimmer.js +0 -124
  227. package/lib/AlexaSmartHomeV3/Controls/Door.js +0 -9
  228. package/lib/AlexaSmartHomeV3/Controls/Gate.js +0 -42
  229. package/lib/AlexaSmartHomeV3/Controls/Hue.js +0 -207
  230. package/lib/AlexaSmartHomeV3/Controls/Lock.js +0 -36
  231. package/lib/AlexaSmartHomeV3/Controls/Motion.js +0 -17
  232. package/lib/AlexaSmartHomeV3/Controls/ReadOnlyDetector.js +0 -25
  233. package/lib/AlexaSmartHomeV3/Controls/Slider.js +0 -10
  234. package/lib/AlexaSmartHomeV3/Controls/Socket.js +0 -21
  235. package/lib/AlexaSmartHomeV3/Controls/Temperature.js +0 -22
  236. package/lib/AlexaSmartHomeV3/Controls/Thermostat.js +0 -86
  237. package/lib/AlexaSmartHomeV3/Controls/VacuumCleaner.js +0 -28
  238. package/lib/AlexaSmartHomeV3/Controls/Volume.js +0 -109
  239. package/lib/AlexaSmartHomeV3/Controls/VolumeGroup.js +0 -9
  240. package/lib/AlexaSmartHomeV3/Controls/Window.js +0 -9
  241. package/lib/AlexaSmartHomeV3/Controls/index.js +0 -14
  242. package/lib/AlexaSmartHomeV3/DeviceManager.js +0 -415
  243. package/lib/AlexaSmartHomeV3/Exceptions/AlexaV3Exception.js +0 -8
  244. package/lib/AlexaSmartHomeV3/Exceptions/HourlyDeviceRateLimitExceeded.js +0 -5
  245. package/lib/AlexaSmartHomeV3/Exceptions/OverallDailyRateLimitExceeded.js +0 -5
  246. package/lib/AlexaSmartHomeV3/Helpers/FileHelper.js +0 -70
  247. package/lib/AlexaSmartHomeV3/Helpers/Logger.js +0 -95
  248. package/lib/AlexaSmartHomeV3/Helpers/RateLimiter.js +0 -82
  249. package/lib/AlexaSmartHomeV3/Helpers/Utils.js +0 -583
  250. package/lib/Utils.js +0 -608
  251. package/lib/adminCommonSocket.js +0 -781
  252. package/lib/alexaCustom.js +0 -622
  253. package/lib/translate.js +0 -19
  254. package/main.js +0 -1454
package/lib/Utils.js DELETED
@@ -1,608 +0,0 @@
1
- // this file was taken unchanged from admin/src-rx/src/Utils.js
2
-
3
- const ANSI_RESET = 0;
4
- const ANSI_RESET_COLOR = 39;
5
- const ANSI_RESET_BG_COLOR = 49;
6
- const ANSI_BOLD = 1;
7
- const ANSI_RESET_BOLD = 22;
8
-
9
- const STYLES = {
10
- 30: { color: 'black' }, // ANSI_BLACK
11
- 31: { color: 'red' }, // ANSI_RED
12
- 32: { color: 'green' }, // ANSI_GREEN
13
- 33: { color: 'yellow' }, // ANSI_YELLOW
14
- 34: { color: 'blue' }, // ANSI_BLUE
15
- 35: { color: 'purple' }, // ANSI_PURPLE
16
- 36: { color: 'cyan' }, // ANSI_CYAN
17
- 37: { color: 'white' }, // ANSI_WHITE
18
-
19
- 90: { color: 'grey' }, // ANSI_BRIGHT_BLACK
20
- 91: { color: 'lightred' }, // ANSI_BRIGHT_RED
21
- 92: { color: 'lightgreen' }, // ANSI_BRIGHT_GREEN
22
- 93: { color: 'lightyellow' }, // ANSI_BRIGHT_YELLOW
23
- 94: { color: 'lightblue' }, // ANSI_BRIGHT_BLUE
24
- 95: { color: 'lightpurple' }, // ANSI_BRIGHT_PURPLE
25
- 96: { color: 'lightcyan' }, // ANSI_BRIGHT_CYAN
26
- 97: { color: 'white' }, // ANSI_BRIGHT_WHITE
27
-
28
- 40: { backgroundColor: 'black' }, // ANSI_BG_BLACK
29
- 41: { backgroundColor: 'red' }, // ANSI_BG_RED
30
- 42: { backgroundColor: 'green' }, // ANSI_BG_GREEN
31
- 43: { backgroundColor: 'yellow' }, // ANSI_BG_YELLOW
32
- 44: { backgroundColor: 'blue' }, // ANSI_BG_BLUE
33
- 45: { backgroundColor: 'purple' }, // ANSI_BG_PURPLE
34
- 46: { backgroundColor: 'cyan' }, // ANSI_BG_CYAN
35
- 47: { backgroundColor: 'white' }, // ANSI_BG_WHITE
36
-
37
- 100: { backgroundColor: 'grey' }, // ANSI_BRIGHT_BG_BLACK
38
- 101: { backgroundColor: 'lightred' }, // ANSI_BRIGHT_BG_RED
39
- 102: { backgroundColor: 'lightgreen' }, // ANSI_BRIGHT_BG_GREEN
40
- 103: { backgroundColor: 'lightyellow' }, // ANSI_BRIGHT_BG_YELLOW
41
- 104: { backgroundColor: 'lightblue' }, // ANSI_BRIGHT_BG_BLUE
42
- 105: { backgroundColor: 'lightpurple' }, // ANSI_BRIGHT_BG_PURPLE
43
- 106: { backgroundColor: 'lightcyan' }, // ANSI_BRIGHT_BG_CYAN
44
- 107: { backgroundColor: 'white' }, // ANSI_BRIGHT_BG_WHITE
45
- };
46
-
47
- class Utils {
48
- /**
49
- * Format bytes to MB or GB
50
- * @param {!number} bytes
51
- * @returns {String}
52
- */
53
- static formatRam(bytes) {
54
- const GB = Math.floor((bytes / (1024 * 1024 * 1024)) * 10) / 10;
55
- bytes %= 1024 * 1024 * 1024;
56
- const MB = Math.floor((bytes / (1024 * 1024)) * 10) / 10;
57
- let text = '';
58
-
59
- if (GB > 1) {
60
- text += GB + ' GB';
61
- } else {
62
- text += MB + ' MB';
63
- }
64
-
65
- return text;
66
- }
67
-
68
- static formatSpeed(mhz) {
69
- return mhz + ' MHz';
70
- }
71
-
72
- static formatBytes(bytes) {
73
- if (Math.abs(bytes) < 1024) {
74
- return bytes + ' B';
75
- }
76
-
77
- const units = ['KB', 'MB', 'GB'];
78
- //const units = ['KiB','MiB','GiB','TiB','PiB','EiB','ZiB','YiB'];
79
- let u = -1;
80
-
81
- do {
82
- bytes /= 1024;
83
- ++u;
84
- } while (Math.abs(bytes) >= 1024 && u < units.length - 1);
85
-
86
- return bytes.toFixed(1) + ' ' + units[u];
87
- }
88
-
89
- static getFileExtension(fileName) {
90
- const pos = fileName.lastIndexOf('.');
91
- if (pos !== -1) {
92
- return fileName.substring(pos + 1).toLowerCase();
93
- } else {
94
- return null;
95
- }
96
- }
97
-
98
- // Big thanks to : https://stackoverflow.com/questions/35969656/how-can-i-generate-the-opposite-color-according-to-current-color
99
- static invertColor(hex, bw) {
100
- if (hex === undefined || hex === null || hex === '' || typeof hex !== 'string') {
101
- return '';
102
- }
103
- if (hex.indexOf('#') === 0) {
104
- hex = hex.slice(1);
105
- }
106
- // convert 3-digit hex to 6-digits.
107
- if (hex.length === 3) {
108
- hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
109
- }
110
- if (hex.length !== 6) {
111
- throw new Error('Invalid HEX color.');
112
- }
113
- let r = parseInt(hex.slice(0, 2), 16);
114
- let g = parseInt(hex.slice(2, 4), 16);
115
- let b = parseInt(hex.slice(4, 6), 16);
116
-
117
- if (bw) {
118
- // http://stackoverflow.com/a/3943023/112731
119
- return r * 0.299 + g * 0.587 + b * 0.114 > 186 ? '#000000' : '#FFFFFF';
120
- }
121
- // invert color components
122
- r = (255 - r).toString(16);
123
- g = (255 - g).toString(16);
124
- b = (255 - b).toString(16);
125
- // pad each with zeros and return
126
- return '#' + r.padStart(2, '0') + g.padStart(2, '0') + b.padStart(2, '0');
127
- }
128
-
129
- /**
130
- * Format number in seconds to a time text
131
- * @param {string} seconds
132
- * @param {function} t translate function
133
- * @returns {String}
134
- */
135
- static formatSeconds(seconds, t) {
136
- const days = Math.floor(seconds / (3600 * 24));
137
- seconds %= 3600 * 24;
138
- let hours = Math.floor(seconds / 3600);
139
- if (hours < 10) {
140
- hours = `0${hours}`;
141
- }
142
- seconds %= 3600;
143
- let minutes = Math.floor(seconds / 60);
144
- if (minutes < 10) {
145
- minutes = `0${minutes}`;
146
- }
147
- seconds %= 60;
148
- seconds = Math.floor(seconds);
149
- if (seconds < 10) {
150
- seconds = `0${seconds}`;
151
- }
152
- let text = '';
153
- if (days) {
154
- text += `${days} ${t('daysShortText')} `;
155
- }
156
- text += `${hours}:${minutes}:${seconds}`;
157
-
158
- return text;
159
- }
160
-
161
- // internal use
162
- static _replaceLink(link, objects, adapterInstance, attr, placeholder, hosts, hostname, adminInstance) {
163
- if (attr === 'protocol') {
164
- attr = 'secure';
165
- }
166
-
167
- try {
168
- const object = objects['system.adapter.' + adapterInstance];
169
-
170
- if (link && object) {
171
- if (attr === 'secure') {
172
- link = link.replace(`%${placeholder}%`, object.native[attr] ? 'https' : 'http');
173
- } else {
174
- let value = object.native[attr];
175
- // workaround for port
176
- if ((attr === 'webinterfacePort' || attr === 'port') && (!value || value === '0')) {
177
- if (object.native.secure === true) {
178
- value = 443;
179
- } else {
180
- value = 80;
181
- }
182
- }
183
-
184
- if (attr === 'bind' || attr === 'ip') {
185
- let ip = object.native.bind || object.native.ip;
186
- if (ip === '0.0.0.0') {
187
- ip = Utils.getHostname(object, objects, hosts, hostname, adminInstance);
188
- }
189
- if (!link.includes(`%${placeholder}%`)) {
190
- link = link.replace(`%native_${placeholder}%`, ip || '');
191
- } else {
192
- link = link.replace(`%${placeholder}%`, ip || '');
193
- }
194
- } else if (!link.includes(`%${placeholder}%`)) {
195
- link = link.replace(`%native_${placeholder}%`, value);
196
- } else {
197
- link = link.replace(`%${placeholder}%`, value);
198
- }
199
- }
200
- } else {
201
- console.log('Cannot get link ' + attr);
202
- link = link.replace(`%${placeholder}%`, '');
203
- }
204
- } catch (error) {
205
- console.log(error);
206
- }
207
- return link;
208
- }
209
-
210
- static ip2int(ip) {
211
- return ip.split('.').reduce((ipInt, octet) => (ipInt << 8) + parseInt(octet, 10), 0) >>> 0;
212
- }
213
-
214
- static findNetworkAddressOfHost(obj, localIp) {
215
- const networkInterfaces = obj && obj.native && obj.native.hardware && obj.native.hardware.networkInterfaces;
216
- if (!networkInterfaces) {
217
- return null;
218
- }
219
-
220
- let hostIp;
221
- Object.keys(networkInterfaces).forEach(inter => {
222
- networkInterfaces[inter].forEach(ip => {
223
- if (ip.internal) {
224
- return;
225
- } else if (localIp.includes(':') && ip.family !== 'IPv6') {
226
- return;
227
- } else if (localIp.includes('.') && !localIp.match(/[^.\d]/) && ip.family !== 'IPv4') {
228
- return;
229
- }
230
- if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\d]/)) {
231
- // if DNS name
232
- hostIp = ip.address;
233
- } else {
234
- if (
235
- ip.family === 'IPv4' &&
236
- localIp.includes('.') &&
237
- (Utils.ip2int(localIp) & Utils.ip2int(ip.netmask)) ===
238
- (Utils.ip2int(ip.address) & Utils.ip2int(ip.netmask))
239
- ) {
240
- hostIp = ip.address;
241
- } else {
242
- hostIp = ip.address;
243
- }
244
- }
245
- });
246
- });
247
-
248
- if (!hostIp) {
249
- Object.keys(networkInterfaces).forEach(inter => {
250
- networkInterfaces[inter].forEach(ip => {
251
- if (ip.internal) {
252
- return;
253
- } else if (localIp.includes(':') && ip.family !== 'IPv6') {
254
- return;
255
- } else if (localIp.includes('.') && !localIp.match(/[^.\d]/) && ip.family !== 'IPv4') {
256
- return;
257
- }
258
- if (localIp === '127.0.0.0' || localIp === 'localhost' || localIp.match(/[^.\d]/)) {
259
- // if DNS name
260
- hostIp = ip.address;
261
- } else {
262
- hostIp = ip.address;
263
- }
264
- });
265
- });
266
- }
267
-
268
- if (!hostIp) {
269
- Object.keys(networkInterfaces).forEach(inter => {
270
- networkInterfaces[inter].forEach(ip => {
271
- if (ip.internal) {
272
- return;
273
- }
274
- hostIp = ip.address;
275
- });
276
- });
277
- }
278
-
279
- return hostIp;
280
- }
281
-
282
- static getHostname(instanceObj, objects, hosts, currentHostname, adminInstance) {
283
- if (!instanceObj || !instanceObj.common) {
284
- return null;
285
- }
286
-
287
- let hostname;
288
- // check if the adapter from the same host as admin
289
- const adminHost =
290
- objects['system.adapter.' + adminInstance] &&
291
- objects['system.adapter.' + adminInstance].common &&
292
- objects['system.adapter.' + adminInstance].common.host;
293
- if (instanceObj.common.host !== adminHost) {
294
- // find IP address
295
- const host = hosts.find(obj => obj._id === 'system.host.' + instanceObj.common.host);
296
- if (host) {
297
- const ip = Utils.findNetworkAddressOfHost(host, currentHostname);
298
- if (ip) {
299
- hostname = ip;
300
- } else {
301
- console.warn(`Cannot find suitable IP in host ${instanceObj.common.host} for ${instanceObj._id}`);
302
- return null;
303
- }
304
- } else {
305
- console.warn(`Cannot find host ${instanceObj.common.host} for ${instanceObj._id}`);
306
- return null;
307
- }
308
- } else {
309
- hostname = currentHostname;
310
- }
311
- return hostname;
312
- }
313
-
314
- /**
315
- * Format number in seconds to time text
316
- * @param {string} link pattern for link
317
- * @param {string} adapter admin name
318
- * @param {string} instance admin instance
319
- * @param {object} context {objects, hostname(of browser), protocol(of browser)}
320
- * @returns {array<any>}
321
- */
322
- static replaceLink(link, adapter, instance, context) {
323
- const _urls = [];
324
- let port;
325
-
326
- if (link) {
327
- const instanceObj = context.objects[`system.adapter.${adapter}.${instance}`];
328
- const native = (instanceObj && instanceObj.native) || {};
329
-
330
- let placeholders = link.match(/%(\w+)%/g);
331
-
332
- if (placeholders) {
333
- for (let p = 0; p < placeholders.length; p++) {
334
- let placeholder = placeholders[p];
335
-
336
- if (placeholder === '%ip%') {
337
- let ip = native.bind || native.ip;
338
- if (!ip || ip === '127.0.0.1' || ip === 'localhost' || ip === '0.0.0.0') {
339
- // Check host
340
- ip = Utils.getHostname(
341
- instanceObj,
342
- context.objects,
343
- context.hosts,
344
- context.hostname,
345
- context.adminInstance,
346
- );
347
- }
348
-
349
- if (_urls.length) {
350
- _urls.forEach(item => (item.url = item.url.replace('%ip%', ip)));
351
- } else {
352
- link = link.replace('%ip%', ip || '');
353
- }
354
- } else if (placeholder === '%protocol%') {
355
- let protocol = native.secure === undefined ? native.protocol : native.secure;
356
- if (protocol === true || protocol === 'true') {
357
- protocol = 'https';
358
- } else if (protocol === false || protocol === 'false' || !protocol) {
359
- protocol = 'http';
360
- }
361
- protocol = protocol.replace(/:$/, '');
362
-
363
- if (_urls.length) {
364
- _urls.forEach(item => (item.url = item.url.replace('%protocol%', protocol)));
365
- } else {
366
- link = link.replace('%protocol%', protocol);
367
- }
368
- } else if (placeholder === '%instance%') {
369
- link = link.replace('%instance%', instance);
370
- if (_urls.length) {
371
- _urls.forEach(item => (item.url = item.url.replace('%instance%', instance)));
372
- } else {
373
- link = link.replace('%instance%', instance);
374
- }
375
- } else {
376
- // remove %%
377
- placeholder = placeholder.replace(/%/g, '');
378
-
379
- if (placeholder.startsWith('native_')) {
380
- placeholder = placeholder.substring(7);
381
- }
382
-
383
- // like web.0_port or web_protocol
384
- if (!placeholder.includes('_')) {
385
- // if only one instance
386
- const adapterInstance = adapter + '.' + instance;
387
- if (_urls.length) {
388
- _urls.forEach(
389
- item =>
390
- (item.url = Utils._replaceLink(
391
- item.url,
392
- context.objects,
393
- adapterInstance,
394
- placeholder,
395
- placeholder,
396
- context.hosts,
397
- context.hostname,
398
- context.adminInstance,
399
- )),
400
- );
401
- } else {
402
- link = Utils._replaceLink(
403
- link,
404
- context.objects,
405
- adapterInstance,
406
- placeholder,
407
- placeholder,
408
- context.hosts,
409
- context.hostname,
410
- context.adminInstance,
411
- );
412
- port =
413
- context.objects['system.adapter.' + adapterInstance] &&
414
- context.objects['system.adapter.' + adapterInstance].native &&
415
- context.objects['system.adapter.' + adapterInstance].native.port;
416
- }
417
- } else {
418
- const [adapterInstance, attr] = placeholder.split('_');
419
-
420
- // if instance number not found
421
- if (!adapterInstance.match(/\.[0-9]+$/)) {
422
- // list all possible instances
423
- let ids;
424
- if (adapter === adapterInstance) {
425
- // take only this one instance and that's all
426
- ids = [adapter + '.' + instance];
427
- } else {
428
- ids = Object.keys(context.objects)
429
- .filter(
430
- id =>
431
- id.startsWith('system.adapter.' + adapterInstance + '.') &&
432
- context.objects[id].common.enabled,
433
- )
434
- .map(id => id.substring(15));
435
- }
436
-
437
- // eslint-disable-next-line
438
- ids.forEach(id => {
439
- if (_urls.length) {
440
- const item = _urls.find(t => t.instance === id);
441
- if (item) {
442
- item.url = Utils._replaceLink(
443
- item.url,
444
- context.objects,
445
- id,
446
- attr,
447
- placeholder,
448
- context.hosts,
449
- context.hostname,
450
- context.adminInstance,
451
- );
452
- } else {
453
- // add new
454
- const _link = Utils._replaceLink(
455
- link,
456
- context.objects,
457
- id,
458
- attr,
459
- placeholder,
460
- context.hosts,
461
- context.hostname,
462
- context.adminInstance,
463
- );
464
- const _port =
465
- context.objects['system.adapter.' + id] &&
466
- context.objects['system.adapter.' + id].native &&
467
- context.objects['system.adapter.' + id].native.port;
468
- _urls.push({ url: _link, port: _port, instance: id });
469
- }
470
- } else {
471
- const _link = Utils._replaceLink(
472
- link,
473
- context.objects,
474
- id,
475
- attr,
476
- placeholder,
477
- context.hosts,
478
- context.hostname,
479
- context.adminInstance,
480
- );
481
- const _port =
482
- context.objects['system.adapter.' + id] &&
483
- context.objects['system.adapter.' + id].native &&
484
- context.objects['system.adapter.' + id].native.port;
485
- _urls.push({ url: _link, port: _port, instance: id });
486
- }
487
- });
488
- } else {
489
- link = Utils._replaceLink(
490
- link,
491
- context.objects,
492
- adapterInstance,
493
- attr,
494
- placeholder,
495
- context.hosts,
496
- context.hostname,
497
- context.adminInstance,
498
- );
499
- port =
500
- context.objects['system.adapter.' + adapterInstance] &&
501
- context.objects['system.adapter.' + adapterInstance].native &&
502
- context.objects['system.adapter.' + adapterInstance].native.port;
503
- }
504
- }
505
- }
506
- }
507
- }
508
- }
509
-
510
- if (_urls.length) {
511
- return _urls;
512
- } else {
513
- return [{ url: link, port }];
514
- }
515
- }
516
-
517
- static objectMap(object, callback) {
518
- let result = [];
519
- for (let key in object) {
520
- result.push(callback(object[key], key));
521
- }
522
- return result;
523
- }
524
-
525
- static fixAdminUI(obj) {
526
- if (obj && obj.common && !obj.common.adminUI) {
527
- if (obj.common.noConfig) {
528
- obj.common.adminUI = obj.common.adminUI || {};
529
- obj.common.adminUI.config = 'none';
530
- } else if (obj.common.jsonConfig) {
531
- obj.common.adminUI = obj.common.adminUI || {};
532
- obj.common.adminUI.config = 'json';
533
- } else if (obj.common.materialize) {
534
- obj.common.adminUI = obj.common.adminUI || {};
535
- obj.common.adminUI.config = 'materialize';
536
- } else {
537
- obj.common.adminUI = obj.common.adminUI || {};
538
- obj.common.adminUI.config = 'html';
539
- }
540
-
541
- if (obj.common.jsonCustom) {
542
- obj.common.adminUI = obj.common.adminUI || {};
543
- obj.common.adminUI.custom = 'json';
544
- } else if (obj.common.supportCustoms) {
545
- obj.common.adminUI = obj.common.adminUI || {};
546
- obj.common.adminUI.custom = 'json';
547
- }
548
-
549
- if (obj.common.materializeTab && obj.common.adminTab) {
550
- obj.common.adminUI = obj.common.adminUI || {};
551
- obj.common.adminUI.tab = 'materialize';
552
- } else if (obj.common.adminTab) {
553
- obj.common.adminUI = obj.common.adminUI || {};
554
- obj.common.adminUI.tab = 'html';
555
- }
556
-
557
- obj.common.adminUI &&
558
- console.warn(
559
- `Please add to "${obj._id.replace(/\.\d+$/, '')}" common.adminUI=${JSON.stringify(obj.common.adminUI)}`,
560
- );
561
- }
562
- }
563
-
564
- static parseColorMessage(text) {
565
- if (text && (text.includes('\u001b[') || text.includes('\u001B['))) {
566
- // eslint-disable-next-line
567
- let m = text.match(/\u001b\[\d+m/gi);
568
- if (m) {
569
- const original = text;
570
- const result = [];
571
- let style = {};
572
- for (let i = 0; i < m.length; i++) {
573
- const pos = text.indexOf(m[i]);
574
- if (pos) {
575
- result.push({ text: text.substring(0, pos), style: JSON.parse(JSON.stringify(style)) });
576
- }
577
- const code = parseInt(m[i].substring(2), 10);
578
- if (STYLES[code]) {
579
- Object.assign(style, STYLES[code]);
580
- } else if (ANSI_RESET_COLOR === code) {
581
- delete style.color;
582
- } else if (ANSI_RESET_BG_COLOR === code) {
583
- delete style.backgroundColor;
584
- } else if (ANSI_RESET_BOLD === code) {
585
- delete style.fontWeight;
586
- } else if (ANSI_BOLD === code) {
587
- style.fontWeight = 'bold';
588
- } else if (ANSI_RESET === code) {
589
- style = {};
590
- }
591
- text = text.substring(m[i].length + pos);
592
- }
593
- if (text) {
594
- result.push({ text, style: JSON.parse(JSON.stringify(style)) });
595
- }
596
-
597
- return { original, parts: result };
598
- } else {
599
- return text;
600
- }
601
- } else {
602
- return text;
603
- }
604
- }
605
- }
606
-
607
- module.exports = Utils;
608
- // export default Utils;