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
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ContactSensor = void 0;
7
+ const Base_1 = __importDefault(require("./Base"));
8
+ const Properties_1 = __importDefault(require("../Properties"));
9
+ class ContactSensor extends Base_1.default {
10
+ initProperties() {
11
+ return [new Properties_1.default.DetectionState()];
12
+ }
13
+ }
14
+ exports.ContactSensor = ContactSensor;
15
+ exports.default = ContactSensor;
16
+ //# sourceMappingURL=ContactSensor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContactSensor.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Capabilities/ContactSensor.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+DAAuC;AAGvC,MAAa,aAAc,SAAQ,cAAI;IACnC,cAAc;QACV,OAAO,CAAC,IAAI,oBAAU,CAAC,cAAc,EAAE,CAAC,CAAC;IAC7C,CAAC;CACJ;AAJD,sCAIC;AAED,kBAAe,aAAa,CAAC","sourcesContent":["import Base from './Base';\nimport Properties from '../Properties';\nimport type { Base as PropertiesBase } from '../Properties/Base';\n\nexport class ContactSensor extends Base {\n initProperties(): PropertiesBase[] {\n return [new Properties.DetectionState()];\n }\n}\n\nexport default ContactSensor;\n"]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Properties_1 = __importDefault(require("../Properties"));
7
+ const Base_1 = __importDefault(require("./Base"));
8
+ class LockController extends Base_1.default {
9
+ initProperties() {
10
+ return [new Properties_1.default.LockState()];
11
+ }
12
+ }
13
+ exports.default = LockController;
14
+ //# sourceMappingURL=LockController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LockController.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Capabilities/LockController.ts"],"names":[],"mappings":";;;;;AAAA,+DAAuC;AACvC,kDAA0B;AAG1B,MAAqB,cAAe,SAAQ,cAAI;IAC5C,cAAc;QACV,OAAO,CAAC,IAAI,oBAAU,CAAC,SAAS,EAAE,CAAC,CAAC;IACxC,CAAC;CACJ;AAJD,iCAIC","sourcesContent":["import Properties from '../Properties';\nimport Base from './Base';\nimport type { Base as PropertiesBase } from '../Properties/Base';\n\nexport default class LockController extends Base {\n initProperties(): PropertiesBase[] {\n return [new Properties.LockState()];\n }\n}\n"]}
@@ -1,15 +1,18 @@
1
- const Properties = require('../Properties');
2
- const Base = require('./Base');
3
-
4
- class ModeController extends Base {
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Base_1 = __importDefault(require("./Base"));
7
+ const Mode_1 = __importDefault(require("../Properties/Mode"));
8
+ class ModeController extends Base_1.default {
9
+ _property;
5
10
  initProperties() {
6
- this._property = new Properties.Mode()
11
+ this._property = new Mode_1.default();
7
12
  return [this._property];
8
13
  }
9
-
10
14
  /**
11
15
  * Returns response to Alexa Discovery directive
12
- * @returns {object}
13
16
  */
14
17
  get alexaResponse() {
15
18
  return {
@@ -19,51 +22,47 @@ class ModeController extends Base {
19
22
  properties: this.discoverableProperties,
20
23
  configuration: this.configurationAsDiscoveryResponse,
21
24
  semantics: this.semanticsAsDiscoveryResponse,
22
- capabilityResources: this.capabilityResourcesAsDiscoveryResponse
25
+ capabilityResources: this.capabilityResourcesAsDiscoveryResponse,
23
26
  };
24
27
  }
25
-
26
28
  get discoverableProperties() {
27
29
  return {
28
- supported: this.properties.map(p => { return { name: p.propertyName } }),
30
+ supported: this.properties.map(p => {
31
+ return { name: p.propertyName };
32
+ }),
29
33
  proactivelyReported: this.proactivelyReported,
30
34
  retrievable: this.retrievable,
31
- nonControllable: false
35
+ nonControllable: false,
32
36
  };
33
37
  }
34
-
35
38
  get capabilityResourcesAsDiscoveryResponse() {
36
- return { friendlyNames: this.friendlyNames }
39
+ return { friendlyNames: this.friendlyNames };
37
40
  }
38
-
39
41
  get friendlyNames() {
40
42
  return [
41
43
  {
42
44
  '@type': 'asset',
43
45
  value: {
44
- assetId: 'Alexa.Setting.Mode'
45
- }
46
- }
47
- ]
46
+ assetId: 'Alexa.Setting.Mode',
47
+ },
48
+ },
49
+ ];
48
50
  }
49
-
50
51
  get instance() {
51
- return `${this._property.instance}`
52
+ return `${this._property.instance}`;
52
53
  }
53
-
54
54
  get configurationAsDiscoveryResponse() {
55
55
  return {
56
56
  ordered: false,
57
- supportedModes: this._property.supportedModes.flatMap(mode => mode.discoveryResponse)
58
- }
57
+ supportedModes: this._property.supportedModes.flatMap(mode => mode.discoveryResponse),
58
+ };
59
59
  }
60
-
61
60
  get semanticsAsDiscoveryResponse() {
62
61
  return {
63
62
  actionMappings: this._property.supportedModes.flatMap(mode => mode.actionMappings),
64
- stateMappings: this._property.supportedModes.flatMap(mode => mode.stateMappings)
65
- }
63
+ stateMappings: this._property.supportedModes.flatMap(mode => mode.stateMappings),
64
+ };
66
65
  }
67
66
  }
68
-
69
- module.exports = ModeController;
67
+ exports.default = ModeController;
68
+ //# sourceMappingURL=ModeController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModeController.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Capabilities/ModeController.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAE1B,8DAAsC;AAStC,MAAqB,cAAe,SAAQ,cAAI;IACpC,SAAS,CAAmB;IAEpC,cAAc;QACV,IAAI,CAAC,SAAS,GAAG,IAAI,cAAI,EAAE,CAAC;QAC5B,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAI,aAAa;QACb,OAAO;YACH,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,UAAU,EAAE,IAAI,CAAC,sBAAsB;YACvC,aAAa,EAAE,IAAI,CAAC,gCAAgC;YACpD,SAAS,EAAE,IAAI,CAAC,4BAA4B;YAC5C,mBAAmB,EAAE,IAAI,CAAC,sCAAsC;SACnE,CAAC;IACN,CAAC;IAED,IAAI,sBAAsB;QAMtB,OAAO;YACH,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBAC/B,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,YAAY,EAAE,CAAC;YACpC,CAAC,CAAC;YACF,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;YAC7C,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,eAAe,EAAE,KAAK;SACzB,CAAC;IACN,CAAC;IAED,IAAI,sCAAsC;QAGtC,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;IACjD,CAAC;IAED,IAAI,aAAa;QACb,OAAO;YACH;gBACI,OAAO,EAAE,OAAO;gBAChB,KAAK,EAAE;oBACH,OAAO,EAAE,oBAAoB;iBAChC;aACJ;SACJ,CAAC;IACN,CAAC;IAED,IAAI,QAAQ;QACR,OAAO,GAAG,IAAI,CAAC,SAAU,CAAC,QAAQ,EAAE,CAAC;IACzC,CAAC;IAED,IAAI,gCAAgC;QAIhC,OAAO;YACH,OAAO,EAAE,KAAK;YACd,cAAc,EAAE,IAAI,CAAC,SAAU,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC;SACzF,CAAC;IACN,CAAC;IAED,IAAI,4BAA4B;QAI5B,OAAO;YACH,cAAc,EAAE,IAAI,CAAC,SAAU,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC;YACnF,aAAa,EAAE,IAAI,CAAC,SAAU,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC;SACpF,CAAC;IACN,CAAC;CACJ;AA/ED,iCA+EC","sourcesContent":["import Base from './Base';\nimport type { Base as PropertiesBase } from '../Properties/Base';\nimport Mode from '../Properties/Mode';\nimport type {\n AlexaV3ActionMapping,\n AlexaV3Capability,\n AlexaV3DiscoveryResponse,\n AlexaV3FriendlyName,\n AlexaV3StateMapping,\n} from '../../types';\n\nexport default class ModeController extends Base {\n private _property: Mode | undefined;\n\n initProperties(): PropertiesBase[] {\n this._property = new Mode();\n return [this._property];\n }\n\n /**\n * Returns response to Alexa Discovery directive\n */\n get alexaResponse(): AlexaV3Capability {\n return {\n interface: this.namespace,\n instance: this.instance,\n version: this.version,\n properties: this.discoverableProperties,\n configuration: this.configurationAsDiscoveryResponse,\n semantics: this.semanticsAsDiscoveryResponse,\n capabilityResources: this.capabilityResourcesAsDiscoveryResponse,\n };\n }\n\n get discoverableProperties(): {\n supported: { name: string }[];\n proactivelyReported: boolean;\n retrievable: boolean;\n nonControllable: false;\n } {\n return {\n supported: this.properties.map(p => {\n return { name: p.propertyName };\n }),\n proactivelyReported: this.proactivelyReported,\n retrievable: this.retrievable,\n nonControllable: false,\n };\n }\n\n get capabilityResourcesAsDiscoveryResponse(): {\n friendlyNames: AlexaV3FriendlyName[];\n } {\n return { friendlyNames: this.friendlyNames };\n }\n\n get friendlyNames(): AlexaV3FriendlyName[] {\n return [\n {\n '@type': 'asset',\n value: {\n assetId: 'Alexa.Setting.Mode',\n },\n },\n ];\n }\n\n get instance(): string {\n return `${this._property!.instance}`;\n }\n\n get configurationAsDiscoveryResponse(): {\n ordered: boolean;\n supportedModes: AlexaV3DiscoveryResponse[];\n } {\n return {\n ordered: false,\n supportedModes: this._property!.supportedModes.flatMap(mode => mode.discoveryResponse),\n };\n }\n\n get semanticsAsDiscoveryResponse(): {\n actionMappings: AlexaV3ActionMapping[];\n stateMappings: AlexaV3StateMapping[];\n } {\n return {\n actionMappings: this._property!.supportedModes.flatMap(mode => mode.actionMappings),\n stateMappings: this._property!.supportedModes.flatMap(mode => mode.stateMappings),\n };\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Properties_1 = __importDefault(require("../Properties"));
7
+ const Base_1 = __importDefault(require("./Base"));
8
+ class MotionSensor extends Base_1.default {
9
+ initProperties() {
10
+ return [new Properties_1.default.DetectionState()];
11
+ }
12
+ }
13
+ exports.default = MotionSensor;
14
+ //# sourceMappingURL=MotionSensor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MotionSensor.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Capabilities/MotionSensor.ts"],"names":[],"mappings":";;;;;AAAA,+DAAuC;AACvC,kDAA0B;AAG1B,MAAqB,YAAa,SAAQ,cAAI;IAC1C,cAAc;QACV,OAAO,CAAC,IAAI,oBAAU,CAAC,cAAc,EAAE,CAAC,CAAC;IAC7C,CAAC;CACJ;AAJD,+BAIC","sourcesContent":["import Properties from '../Properties';\nimport Base from './Base';\nimport type { Base as PropertiesBase } from '../Properties/Base';\n\nexport default class MotionSensor extends Base {\n initProperties(): PropertiesBase[] {\n return [new Properties.DetectionState()];\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Properties_1 = __importDefault(require("../Properties"));
7
+ const Base_1 = __importDefault(require("./Base"));
8
+ class PercentageController extends Base_1.default {
9
+ initProperties() {
10
+ return [new Properties_1.default.Percentage()];
11
+ }
12
+ }
13
+ exports.default = PercentageController;
14
+ //# sourceMappingURL=PercentageController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PercentageController.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Capabilities/PercentageController.ts"],"names":[],"mappings":";;;;;AAAA,+DAAuC;AACvC,kDAA0B;AAG1B,MAAqB,oBAAqB,SAAQ,cAAI;IAClD,cAAc;QACV,OAAO,CAAC,IAAI,oBAAU,CAAC,UAAU,EAAE,CAAC,CAAC;IACzC,CAAC;CACJ;AAJD,uCAIC","sourcesContent":["import Properties from '../Properties';\nimport Base from './Base';\nimport type { Base as PropertiesBase } from '../Properties/Base';\n\nexport default class PercentageController extends Base {\n initProperties(): PropertiesBase[] {\n return [new Properties.Percentage()];\n }\n}\n"]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const PowerState_1 = __importDefault(require("../Properties/PowerState"));
7
+ const Base_1 = __importDefault(require("./Base"));
8
+ class PowerController extends Base_1.default {
9
+ _powerState;
10
+ initProperties() {
11
+ this._powerState = new PowerState_1.default();
12
+ return [this._powerState];
13
+ }
14
+ get powerState() {
15
+ return this._powerState;
16
+ }
17
+ }
18
+ exports.default = PowerController;
19
+ //# sourceMappingURL=PowerController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PowerController.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Capabilities/PowerController.ts"],"names":[],"mappings":";;;;;AAAA,0EAAkD;AAClD,kDAA0B;AAG1B,MAAqB,eAAgB,SAAQ,cAAI;IACrC,WAAW,CAAyB;IAE5C,cAAc;QACV,IAAI,CAAC,WAAW,GAAG,IAAI,oBAAU,EAAE,CAAC;QACpC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,WAAY,CAAC;IAC7B,CAAC;CACJ;AAXD,kCAWC","sourcesContent":["import PowerState from '../Properties/PowerState';\nimport Base from './Base';\nimport type { Base as PropertiesBase } from '../Properties/Base';\n\nexport default class PowerController extends Base {\n private _powerState: PowerState | undefined;\n\n initProperties(): PropertiesBase[] {\n this._powerState = new PowerState();\n return [this._powerState];\n }\n\n get powerState(): PropertiesBase {\n return this._powerState!;\n }\n}\n"]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Volume_1 = __importDefault(require("../Properties/Volume"));
7
+ const Muted_1 = __importDefault(require("../Properties/Muted"));
8
+ const Base_1 = __importDefault(require("./Base"));
9
+ class Speaker extends Base_1.default {
10
+ _volume;
11
+ _muted;
12
+ initProperties() {
13
+ this._volume = new Volume_1.default();
14
+ this._muted = new Muted_1.default();
15
+ return [this._volume, this._muted];
16
+ }
17
+ get volume() {
18
+ return this._volume;
19
+ }
20
+ get muted() {
21
+ return this._muted;
22
+ }
23
+ }
24
+ exports.default = Speaker;
25
+ //# sourceMappingURL=Speaker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Speaker.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Capabilities/Speaker.ts"],"names":[],"mappings":";;;;;AAAA,kEAA0C;AAC1C,gEAAwC;AACxC,kDAA0B;AAG1B,MAAqB,OAAQ,SAAQ,cAAI;IAC7B,OAAO,CAAqB;IAC5B,MAAM,CAAoB;IAElC,cAAc;QACV,IAAI,CAAC,OAAO,GAAG,IAAI,gBAAM,EAAE,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,eAAK,EAAE,CAAC;QAC1B,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAQ,CAAC;IACzB,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,MAAO,CAAC;IACxB,CAAC;CACJ;AAjBD,0BAiBC","sourcesContent":["import Volume from '../Properties/Volume';\nimport Muted from '../Properties/Muted';\nimport Base from './Base';\nimport type { Base as PropertiesBase } from '../Properties/Base';\n\nexport default class Speaker extends Base {\n private _volume: Volume | undefined;\n private _muted: Muted | undefined;\n\n initProperties(): PropertiesBase[] {\n this._volume = new Volume();\n this._muted = new Muted();\n return [this._volume, this._muted];\n }\n\n get volume(): Volume {\n return this._volume!;\n }\n\n get muted(): Muted {\n return this._muted!;\n }\n}\n"]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Properties_1 = __importDefault(require("../Properties"));
7
+ const Base_1 = __importDefault(require("./Base"));
8
+ class TemperatureSensor extends Base_1.default {
9
+ initProperties() {
10
+ return [new Properties_1.default.Temperature()];
11
+ }
12
+ }
13
+ exports.default = TemperatureSensor;
14
+ //# sourceMappingURL=TemperatureSensor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemperatureSensor.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Capabilities/TemperatureSensor.ts"],"names":[],"mappings":";;;;;AAAA,+DAAuC;AACvC,kDAA0B;AAG1B,MAAqB,iBAAkB,SAAQ,cAAI;IAC/C,cAAc;QACV,OAAO,CAAC,IAAI,oBAAU,CAAC,WAAW,EAAE,CAAC,CAAC;IAC1C,CAAC;CACJ;AAJD,oCAIC","sourcesContent":["import Properties from '../Properties';\nimport Base from './Base';\nimport type { Base as PropertiesBase } from '../Properties/Base';\n\nexport default class TemperatureSensor extends Base {\n initProperties(): PropertiesBase[] {\n return [new Properties.Temperature()];\n }\n}\n"]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const ThermostatMode_1 = __importDefault(require("../Properties/ThermostatMode"));
7
+ const TargetSetpoint_1 = __importDefault(require("../Properties/TargetSetpoint"));
8
+ const Base_1 = __importDefault(require("./Base"));
9
+ class ThermostatController extends Base_1.default {
10
+ _thermostatMode;
11
+ get version() {
12
+ return '3.2';
13
+ }
14
+ initProperties() {
15
+ this._thermostatMode = new ThermostatMode_1.default();
16
+ return [new TargetSetpoint_1.default(), this._thermostatMode];
17
+ }
18
+ get thermostatMode() {
19
+ return this._thermostatMode;
20
+ }
21
+ get alexaResponse() {
22
+ return {
23
+ interface: this.namespace,
24
+ version: this.version,
25
+ properties: this.discoverableProperties,
26
+ configuration: this.configuration,
27
+ };
28
+ }
29
+ get configuration() {
30
+ return {
31
+ ordered: false,
32
+ supportedModes: this._thermostatMode.supportedModes,
33
+ };
34
+ }
35
+ }
36
+ exports.default = ThermostatController;
37
+ //# sourceMappingURL=ThermostatController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThermostatController.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Capabilities/ThermostatController.ts"],"names":[],"mappings":";;;;;AAAA,kFAA0D;AAC1D,kFAA0D;AAC1D,kDAA0B;AAI1B,MAAqB,oBAAqB,SAAQ,cAAI;IAC1C,eAAe,CAA6B;IAEpD,IAAI,OAAO;QACP,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,cAAc;QACV,IAAI,CAAC,eAAe,GAAG,IAAI,wBAAc,EAAE,CAAC;QAC5C,OAAO,CAAC,IAAI,wBAAc,EAAE,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,eAAgB,CAAC;IACjC,CAAC;IAED,IAAI,aAAa;QAsBb,OAAO;YACH,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,UAAU,EAAE,IAAI,CAAC,sBAAsB;YACvC,aAAa,EAAE,IAAI,CAAC,aAAa;SACpC,CAAC;IACN,CAAC;IAED,IAAI,aAAa;QAKb,OAAO;YACH,OAAO,EAAE,KAAK;YACd,cAAc,EAAE,IAAI,CAAC,eAAgB,CAAC,cAAc;SACvD,CAAC;IACN,CAAC;CACJ;AAxDD,uCAwDC","sourcesContent":["import ThermostatMode from '../Properties/ThermostatMode';\nimport TargetSetpoint from '../Properties/TargetSetpoint';\nimport Base from './Base';\nimport type { Base as PropertiesBase } from '../Properties/Base';\nimport type { AlexaV3ActionMapping, AlexaV3FriendlyName, AlexaV3Namespace, AlexaV3StateMapping } from '../../types';\n\nexport default class ThermostatController extends Base {\n private _thermostatMode: ThermostatMode | undefined;\n\n get version(): string {\n return '3.2';\n }\n\n initProperties(): PropertiesBase[] {\n this._thermostatMode = new ThermostatMode();\n return [new TargetSetpoint(), this._thermostatMode];\n }\n\n get thermostatMode(): ThermostatMode {\n return this._thermostatMode!;\n }\n\n get alexaResponse(): {\n interface: AlexaV3Namespace;\n version: string;\n instance?: string;\n properties: {\n supported: { name: string }[];\n proactivelyReported: boolean;\n retrievable: boolean;\n };\n configuration?: {\n ordered: boolean;\n supportedModes: any[];\n supportsScheduling?: boolean;\n };\n semantics?: {\n actionMappings: AlexaV3ActionMapping[];\n stateMappings: AlexaV3StateMapping[];\n };\n capabilityResources?: {\n friendlyNames: AlexaV3FriendlyName[];\n };\n } {\n return {\n interface: this.namespace,\n version: this.version,\n properties: this.discoverableProperties,\n configuration: this.configuration,\n };\n }\n\n get configuration(): {\n ordered: boolean;\n supportedModes: string[];\n supportsScheduling?: boolean;\n } {\n return {\n ordered: false,\n supportedModes: this._thermostatMode!.supportedModes,\n };\n }\n}\n"]}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const BrightnessController_1 = __importDefault(require("./BrightnessController"));
7
+ const ColorController_1 = __importDefault(require("./ColorController"));
8
+ const ColorTemperatureController_1 = __importDefault(require("./ColorTemperatureController"));
9
+ const ContactSensor_1 = __importDefault(require("./ContactSensor"));
10
+ const LockController_1 = __importDefault(require("./LockController"));
11
+ const ModeController_1 = __importDefault(require("./ModeController"));
12
+ const MotionSensor_1 = __importDefault(require("./MotionSensor"));
13
+ const PercentageController_1 = __importDefault(require("./PercentageController"));
14
+ const PowerController_1 = __importDefault(require("./PowerController"));
15
+ const Speaker_1 = __importDefault(require("./Speaker"));
16
+ const TemperatureSensor_1 = __importDefault(require("./TemperatureSensor"));
17
+ const ThermostatController_1 = __importDefault(require("./ThermostatController"));
18
+ exports.default = {
19
+ BrightnessController: BrightnessController_1.default,
20
+ ColorController: ColorController_1.default,
21
+ ColorTemperatureController: ColorTemperatureController_1.default,
22
+ ContactSensor: ContactSensor_1.default,
23
+ LockController: LockController_1.default,
24
+ ModeController: ModeController_1.default,
25
+ MotionSensor: MotionSensor_1.default,
26
+ PercentageController: PercentageController_1.default,
27
+ PowerController: PowerController_1.default,
28
+ Speaker: Speaker_1.default,
29
+ TemperatureSensor: TemperatureSensor_1.default,
30
+ ThermostatController: ThermostatController_1.default,
31
+ };
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Capabilities/index.ts"],"names":[],"mappings":";;;;;AAAA,kFAA0D;AAC1D,wEAAgD;AAChD,8FAAsE;AACtE,oEAA4C;AAC5C,sEAA8C;AAC9C,sEAA8C;AAC9C,kEAA0C;AAC1C,kFAA0D;AAC1D,wEAAgD;AAChD,wDAAgC;AAChC,4EAAoD;AACpD,kFAA0D;AAE1D,kBAAe;IACX,oBAAoB,EAApB,8BAAoB;IACpB,eAAe,EAAf,yBAAe;IACf,0BAA0B,EAA1B,oCAA0B;IAC1B,aAAa,EAAb,uBAAa;IACb,cAAc,EAAd,wBAAc;IACd,cAAc,EAAd,wBAAc;IACd,YAAY,EAAZ,sBAAY;IACZ,oBAAoB,EAApB,8BAAoB;IACpB,eAAe,EAAf,yBAAe;IACf,OAAO,EAAP,iBAAO;IACP,iBAAiB,EAAjB,2BAAiB;IACjB,oBAAoB,EAApB,8BAAoB;CACvB,CAAC","sourcesContent":["import BrightnessController from './BrightnessController';\nimport ColorController from './ColorController';\nimport ColorTemperatureController from './ColorTemperatureController';\nimport ContactSensor from './ContactSensor';\nimport LockController from './LockController';\nimport ModeController from './ModeController';\nimport MotionSensor from './MotionSensor';\nimport PercentageController from './PercentageController';\nimport PowerController from './PowerController';\nimport Speaker from './Speaker';\nimport TemperatureSensor from './TemperatureSensor';\nimport ThermostatController from './ThermostatController';\n\nexport default {\n BrightnessController,\n ColorController,\n ColorTemperatureController,\n ContactSensor,\n LockController,\n ModeController,\n MotionSensor,\n PercentageController,\n PowerController,\n Speaker,\n TemperatureSensor,\n ThermostatController,\n};\n"]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Logger_1 = __importDefault(require("../../Helpers/Logger"));
7
+ const Utils_1 = require("../../Helpers/Utils");
8
+ class Base {
9
+ log;
10
+ constructor() {
11
+ this.log = new Logger_1.default(this);
12
+ }
13
+ static get namespace() {
14
+ return `Alexa.${(0, Utils_1.className)(this.toString())}`;
15
+ }
16
+ /**
17
+ * Checks whether the directive matches, i.e., can handle the event Alexa sends to the skill
18
+ *
19
+ * @param event Contains the Alexa event.
20
+ */
21
+ static matches(event) {
22
+ return event?.directive?.header?.namespace === this.namespace;
23
+ }
24
+ handle(_event, _endpointManager) {
25
+ return Promise.resolve(null);
26
+ }
27
+ }
28
+ exports.default = Base;
29
+ //# sourceMappingURL=Base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Base.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Directives/Base.ts"],"names":[],"mappings":";;;;;AAAA,kEAA0C;AAC1C,+CAAgD;AAKhD,MAAqB,IAAI;IACX,GAAG,CAAS;IAEtB;QACI,IAAI,CAAC,GAAG,GAAG,IAAI,gBAAM,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,KAAK,SAAS;QAChB,OAAO,SAAS,IAAA,iBAAS,EAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAsB,CAAC;IACrE,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,KAAqB;QAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,KAAK,IAAI,CAAC,SAAS,CAAC;IAClE,CAAC;IAED,MAAM,CAAC,MAAsB,EAAE,gBAA+B;QAC1D,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CACJ;AAvBD,uBAuBC","sourcesContent":["import Logger from '../../Helpers/Logger';\nimport { className } from '../../Helpers/Utils';\nimport type { AlexaV3Namespace, AlexaV3Request } from '../../types';\nimport type AlexaResponse from '../AlexaResponse';\nimport type DeviceManager from '../../DeviceManager';\n\nexport default class Base {\n protected log: Logger;\n\n constructor() {\n this.log = new Logger(this);\n }\n\n static get namespace(): AlexaV3Namespace {\n return `Alexa.${className(this.toString())}` as AlexaV3Namespace;\n }\n\n /**\n * Checks whether the directive matches, i.e., can handle the event Alexa sends to the skill\n *\n * @param event Contains the Alexa event.\n */\n static matches(event: AlexaV3Request): boolean {\n return event?.directive?.header?.namespace === this.namespace;\n }\n\n handle(_event: AlexaV3Request, _endpointManager: DeviceManager): Promise<null | AlexaResponse> {\n return Promise.resolve(null);\n }\n}\n"]}
@@ -1,7 +1,11 @@
1
- const Utils = require('../../Helpers/Utils');
2
- const AlexaResponse = require('../AlexaResponse');
3
- const Base = require('./Base');
4
-
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Utils_1 = require("../../Helpers/Utils");
7
+ const AlexaResponse_1 = __importDefault(require("../AlexaResponse"));
8
+ const Base_1 = __importDefault(require("./Base"));
5
9
  /**
6
10
  * When the state of an endpoint changes for any reason, we report that change to Alexa in an Alexa.ChangeReport event.
7
11
  * Alexa can then provide the status change to the customer.
@@ -12,64 +16,67 @@ const Base = require('./Base');
12
16
  * If the properties of an interface are reported as proactivelyReported during discovery,
13
17
  * we must send Alexa an Alexa.ChangeReport event whenever a property value changes.
14
18
  * If a state change happens because of a directive from Alexa, we send both a directive response and a change report event.
15
- * @class
16
19
  */
17
- class ChangeReport extends Base {
20
+ class ChangeReport extends Base_1.default {
18
21
  static matches(event) {
19
- return event?.directive?.header?.name === Utils.className(this.toString());
22
+ return event?.directive?.header?.name === (0, Utils_1.className)(this.toString());
20
23
  }
21
-
22
- static get(endpointId, propertyName, isPhysicalInteraction) {
24
+ static get(endpointId, propertyName, isPhysicalInteraction, messageId) {
23
25
  return {
24
26
  directive: {
25
27
  header: {
26
- name: Utils.className(this.toString()),
28
+ name: (0, Utils_1.className)(this.toString()),
27
29
  propertyName: propertyName,
28
30
  physicalInteraction: isPhysicalInteraction,
31
+ messageId,
32
+ payloadVersion: '3',
33
+ namespace: 'Alexa',
29
34
  },
30
35
  endpoint: {
36
+ scope: {
37
+ type: 'BearerToken',
38
+ token: '',
39
+ },
31
40
  endpointId,
32
41
  },
42
+ payload: {},
33
43
  },
34
44
  };
35
45
  }
36
-
37
46
  async handle(event, endpointManager) {
38
47
  this.log.debug(`handling ChangeReport`);
39
48
  this.log.silly(`${JSON.stringify(event)}`);
40
-
41
49
  const endpointId = event.directive?.endpoint?.endpointId;
42
50
  const propertyName = event.directive?.header?.propertyName;
43
- const changeCauseType = event.directive?.header?.physicalInteraction ? 'PHYSICAL_INTERACTION' : 'VOICE_INTERACTION';
44
-
45
- let response = new AlexaResponse({
51
+ const changeCauseType = event.directive?.header?.physicalInteraction
52
+ ? 'PHYSICAL_INTERACTION'
53
+ : 'VOICE_INTERACTION';
54
+ let response = new AlexaResponse_1.default({
46
55
  namespace: 'Alexa',
47
56
  name: 'ChangeReport',
57
+ messageId: event?.directive?.header?.messageId,
48
58
  endpointId,
49
59
  changeCauseType,
50
60
  });
51
-
52
61
  response.addContext();
53
-
54
- const endpoint = endpointManager.endpointById(endpointId);
55
-
56
- if (endpoint) {
62
+ const endpoint = endpointId ? endpointManager.endpointById(endpointId) : null;
63
+ if (endpoint?.reportState) {
57
64
  const properties = await endpoint.reportState();
58
65
  for (const property of properties) {
59
66
  if (propertyName === property.name) {
60
67
  response.addPayloadChangeProperty(property);
61
- } else {
68
+ }
69
+ else {
62
70
  response.addContextProperty(property);
63
71
  }
64
72
  }
65
- } else {
66
- response = AlexaResponse.nonExistingEndpoint(endpointId);
67
73
  }
68
-
74
+ else {
75
+ response = AlexaResponse_1.default.nonExistingEndpoint(event.directive.header.messageId, endpointId);
76
+ }
69
77
  this.log.debug(`${JSON.stringify(response.get())}`);
70
-
71
78
  return response.get();
72
79
  }
73
80
  }
74
-
75
- module.exports = ChangeReport;
81
+ exports.default = ChangeReport;
82
+ //# sourceMappingURL=ChangeReport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChangeReport.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Directives/ChangeReport.ts"],"names":[],"mappings":";;;;;AAAA,+CAAgD;AAChD,qEAA6C;AAC7C,kDAA0B;AAI1B;;;;;;;;;;GAUG;AACH,MAAqB,YAAa,SAAQ,cAAI;IAC1C,MAAM,CAAC,OAAO,CAAC,KAAqB;QAChC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,KAAK,IAAA,iBAAS,EAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,CAAC,GAAG,CACN,UAA6B,EAC7B,YAAoB,EACpB,qBAA8B,EAC9B,SAAiB;QAEjB,OAAO;YACH,SAAS,EAAE;gBACP,MAAM,EAAE;oBACJ,IAAI,EAAE,IAAA,iBAAS,EAAC,IAAI,CAAC,QAAQ,EAAE,CAAyB;oBACxD,YAAY,EAAE,YAAY;oBAC1B,mBAAmB,EAAE,qBAAqB;oBAC1C,SAAS;oBACT,cAAc,EAAE,GAAG;oBACnB,SAAS,EAAE,OAAO;iBACrB;gBACD,QAAQ,EAAE;oBACN,KAAK,EAAE;wBACH,IAAI,EAAE,aAAa;wBACnB,KAAK,EAAE,EAAE;qBACZ;oBACD,UAAU;iBACb;gBACD,OAAO,EAAE,EAAE;aACd;SACJ,CAAC;IACN,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAqB,EAAE,eAA8B;QAC9D,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;QACxC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAE3C,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC;QACzD,MAAM,YAAY,GAAG,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,YAAY,CAAC;QAC3D,MAAM,eAAe,GAAG,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,mBAAmB;YAChE,CAAC,CAAC,sBAAsB;YACxB,CAAC,CAAC,mBAAmB,CAAC;QAE1B,IAAI,QAAQ,GAAG,IAAI,uBAAa,CAAC;YAC7B,SAAS,EAAE,OAAO;YAClB,IAAI,EAAE,cAAc;YACpB,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS;YAC9C,UAAU;YACV,eAAe;SAClB,CAAC,CAAC;QAEH,QAAQ,CAAC,UAAU,EAAE,CAAC;QAEtB,MAAM,QAAQ,GAAG,UAAU,CAAC,CAAC,CAAC,eAAe,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAE9E,IAAI,QAAQ,EAAE,WAAW,EAAE,CAAC;YACxB,MAAM,UAAU,GAAG,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC;YAChD,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;gBAChC,IAAI,YAAY,KAAK,QAAQ,CAAC,IAAI,EAAE,CAAC;oBACjC,QAAQ,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;gBAChD,CAAC;qBAAM,CAAC;oBACJ,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;gBAC1C,CAAC;YACL,CAAC;QACL,CAAC;aAAM,CAAC;YACJ,QAAQ,GAAG,uBAAa,CAAC,mBAAmB,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QAC/F,CAAC;QAED,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAEpD,OAAO,QAAQ,CAAC,GAAG,EAAE,CAAC;IAC1B,CAAC;CACJ;AAxED,+BAwEC","sourcesContent":["import { className } from '../../Helpers/Utils';\nimport AlexaResponse from '../AlexaResponse';\nimport Base from './Base';\nimport type { AlexaV3DirectiveType, AlexaV3EndpointID, AlexaV3Request } from '../../types';\nimport type DeviceManager from '../../DeviceManager';\n\n/**\n * When the state of an endpoint changes for any reason, we report that change to Alexa in an Alexa.ChangeReport event.\n * Alexa can then provide the status change to the customer.\n * In the change report, we specify the state of any changed properties in the payload object.\n * For example, if a customer manually turns on a light, we send a change report event that indicates the powerState property\n * of the Alexa.PowerController interface has changed its value to ON.\n *\n * If the properties of an interface are reported as proactivelyReported during discovery,\n * we must send Alexa an Alexa.ChangeReport event whenever a property value changes.\n * If a state change happens because of a directive from Alexa, we send both a directive response and a change report event.\n */\nexport default class ChangeReport extends Base {\n static matches(event: AlexaV3Request): boolean {\n return event?.directive?.header?.name === className(this.toString());\n }\n\n static get(\n endpointId: AlexaV3EndpointID,\n propertyName: string,\n isPhysicalInteraction: boolean,\n messageId: string,\n ): AlexaV3Request {\n return {\n directive: {\n header: {\n name: className(this.toString()) as AlexaV3DirectiveType,\n propertyName: propertyName,\n physicalInteraction: isPhysicalInteraction,\n messageId,\n payloadVersion: '3',\n namespace: 'Alexa',\n },\n endpoint: {\n scope: {\n type: 'BearerToken',\n token: '',\n },\n endpointId,\n },\n payload: {},\n },\n };\n }\n\n async handle(event: AlexaV3Request, endpointManager: DeviceManager): Promise<AlexaResponse> {\n this.log.debug(`handling ChangeReport`);\n this.log.silly(`${JSON.stringify(event)}`);\n\n const endpointId = event.directive?.endpoint?.endpointId;\n const propertyName = event.directive?.header?.propertyName;\n const changeCauseType = event.directive?.header?.physicalInteraction\n ? 'PHYSICAL_INTERACTION'\n : 'VOICE_INTERACTION';\n\n let response = new AlexaResponse({\n namespace: 'Alexa',\n name: 'ChangeReport',\n messageId: event?.directive?.header?.messageId,\n endpointId,\n changeCauseType,\n });\n\n response.addContext();\n\n const endpoint = endpointId ? endpointManager.endpointById(endpointId) : null;\n\n if (endpoint?.reportState) {\n const properties = await endpoint.reportState();\n for (const property of properties) {\n if (propertyName === property.name) {\n response.addPayloadChangeProperty(property);\n } else {\n response.addContextProperty(property);\n }\n }\n } else {\n response = AlexaResponse.nonExistingEndpoint(event.directive.header.messageId, endpointId);\n }\n\n this.log.debug(`${JSON.stringify(response.get())}`);\n\n return response.get();\n }\n}\n"]}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const AlexaResponse_1 = __importDefault(require("../AlexaResponse"));
7
+ const Base_1 = __importDefault(require("./Base"));
8
+ class Discovery extends Base_1.default {
9
+ handle(event, endpointManager) {
10
+ this.log.debug(`handling Discovery`);
11
+ this.log.silly(`${JSON.stringify(event)}`);
12
+ const endpoints = endpointManager.endpoints;
13
+ const response = new AlexaResponse_1.default({
14
+ namespace: Discovery.namespace,
15
+ name: 'Discover.Response',
16
+ messageId: event?.directive?.header?.messageId,
17
+ });
18
+ let count = 0;
19
+ endpoints.forEach(endpoint => {
20
+ count++;
21
+ if (count > 300) {
22
+ this.log.warn(`Too many devices. Alexa supports up to 300 devices. ${endpoint.friendlyName} will not be discovered.`);
23
+ return;
24
+ }
25
+ response.addPayloadEndpoint({
26
+ endpointId: endpoint.id,
27
+ description: endpoint.description || undefined,
28
+ friendlyName: endpoint.friendlyName,
29
+ displayCategories: endpoint.displayCategories || [],
30
+ capabilities: endpoint.capabilities?.map(capability => response.asEndpointCapability(capability.alexaResponse)) ||
31
+ [],
32
+ });
33
+ });
34
+ this.log.silly(`${JSON.stringify(response.get())}`);
35
+ return Promise.resolve(response.get());
36
+ }
37
+ }
38
+ exports.default = Discovery;
39
+ //# sourceMappingURL=Discovery.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Discovery.js","sourceRoot":"","sources":["../../../../../src/lib/AlexaSmartHomeV3/Alexa/Directives/Discovery.ts"],"names":[],"mappings":";;;;;AAAA,qEAA6C;AAC7C,kDAA0B;AAI1B,MAAqB,SAAU,SAAQ,cAAI;IACvC,MAAM,CAAC,KAAqB,EAAE,eAA8B;QACxD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACrC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAE3C,MAAM,SAAS,GAAG,eAAe,CAAC,SAAS,CAAC;QAE5C,MAAM,QAAQ,GAAG,IAAI,uBAAa,CAAC;YAC/B,SAAS,EAAE,SAAS,CAAC,SAAS;YAC9B,IAAI,EAAE,mBAAmB;YACzB,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS;SACjD,CAAC,CAAC;QAEH,IAAI,KAAK,GAAG,CAAC,CAAC;QAEd,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACzB,KAAK,EAAE,CAAC;YACR,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;gBACd,IAAI,CAAC,GAAG,CAAC,IAAI,CACT,uDAAuD,QAAQ,CAAC,YAAY,0BAA0B,CACzG,CAAC;gBACF,OAAO;YACX,CAAC;YACD,QAAQ,CAAC,kBAAkB,CAAC;gBACxB,UAAU,EAAE,QAAQ,CAAC,EAAE;gBACvB,WAAW,EAAE,QAAQ,CAAC,WAAW,IAAI,SAAS;gBAC9C,YAAY,EAAE,QAAQ,CAAC,YAAY;gBACnC,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB,IAAI,EAAE;gBACnD,YAAY,EACR,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;oBACjG,EAAE;aACT,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAEpD,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3C,CAAC;CACJ;AAtCD,4BAsCC","sourcesContent":["import AlexaResponse from '../AlexaResponse';\nimport Base from './Base';\nimport type { AlexaV3Request } from '../../types';\nimport type DeviceManager from '../../DeviceManager';\n\nexport default class Discovery extends Base {\n handle(event: AlexaV3Request, endpointManager: DeviceManager): Promise<AlexaResponse> {\n this.log.debug(`handling Discovery`);\n this.log.silly(`${JSON.stringify(event)}`);\n\n const endpoints = endpointManager.endpoints;\n\n const response = new AlexaResponse({\n namespace: Discovery.namespace,\n name: 'Discover.Response',\n messageId: event?.directive?.header?.messageId,\n });\n\n let count = 0;\n\n endpoints.forEach(endpoint => {\n count++;\n if (count > 300) {\n this.log.warn(\n `Too many devices. Alexa supports up to 300 devices. ${endpoint.friendlyName} will not be discovered.`,\n );\n return;\n }\n response.addPayloadEndpoint({\n endpointId: endpoint.id,\n description: endpoint.description || undefined,\n friendlyName: endpoint.friendlyName,\n displayCategories: endpoint.displayCategories || [],\n capabilities:\n endpoint.capabilities?.map(capability => response.asEndpointCapability(capability.alexaResponse)) ||\n [],\n });\n });\n\n this.log.silly(`${JSON.stringify(response.get())}`);\n\n return Promise.resolve(response.get());\n }\n}\n"]}
@@ -1,7 +1,11 @@
1
- const Utils = require('../../Helpers/Utils');
2
- const AlexaResponse = require('../AlexaResponse');
3
- const Base = require('./Base');
4
-
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const Utils_1 = require("../../Helpers/Utils");
7
+ const AlexaResponse_1 = __importDefault(require("../AlexaResponse"));
8
+ const Base_1 = __importDefault(require("./Base"));
5
9
  /**
6
10
  * When Alexa sends an Alexa.ReportState directive to request the state of an endpoint, the skill sends an Alexa.StateReport response.
7
11
  * This response contains the current state of all the properties that are retrievable.
@@ -10,41 +14,34 @@ const Base = require('./Base');
10
14
  * - endpoint for the report is identified in the endpoint object
11
15
  * - the payload is set to an empty object
12
16
  * - correlationToken set to the value from the Alexa.ReportState request
13
- * @class
14
17
  */
15
- class ReportState extends Base {
18
+ class ReportState extends Base_1.default {
16
19
  static matches(event) {
17
- return event?.directive?.header?.name === Utils.className(this.toString());
20
+ return event?.directive?.header?.name === (0, Utils_1.className)(this.toString());
18
21
  }
19
-
20
22
  async handle(event, endpointManager) {
21
-
22
23
  this.log.debug(`handling ReportState`);
23
24
  this.log.silly(`${JSON.stringify(event)}`);
24
-
25
25
  const endpointId = event.directive?.endpoint?.endpointId;
26
-
27
- let response = new AlexaResponse({
26
+ let response = new AlexaResponse_1.default({
28
27
  namespace: 'Alexa',
29
28
  name: 'StateReport',
30
29
  correlationToken: event.directive?.header?.correlationToken,
31
30
  token: event.directive?.endpoint?.scope?.token,
31
+ messageId: event.directive?.header?.messageId,
32
32
  endpointId,
33
33
  });
34
-
35
- const endpoint = endpointManager.endpointById(endpointId);
36
-
37
- if (endpoint) {
34
+ const endpoint = endpointId ? endpointManager.endpointById(endpointId) : null;
35
+ if (endpoint?.reportState) {
38
36
  const properties = await endpoint.reportState();
39
37
  properties.forEach(property => response.addContextProperty(property));
40
- } else {
41
- response = AlexaResponse.nonExistingEndpoint(endpointId);
42
38
  }
43
-
39
+ else {
40
+ response = AlexaResponse_1.default.nonExistingEndpoint(event.directive.header.messageId, endpointId);
41
+ }
44
42
  this.log.silly(`${JSON.stringify(response.get())}`);
45
-
46
43
  return response.get();
47
44
  }
48
45
  }
49
-
50
- module.exports = ReportState;
46
+ exports.default = ReportState;
47
+ //# sourceMappingURL=ReportState.js.map