node-poweredup 8.0.4 → 9.0.0

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 (300) hide show
  1. package/.drone.yml +2 -2
  2. package/.gitmodules +0 -3
  3. package/.jsdoc.json +1 -2
  4. package/dist/browser/poweredup.js +1 -1
  5. package/dist/browser/poweredup.js.map +1 -1
  6. package/dist/node/color.js +5 -1
  7. package/dist/node/color.js.map +1 -1
  8. package/dist/node/consts.d.ts +21 -21
  9. package/dist/node/consts.js +27 -27
  10. package/dist/node/consts.js.map +1 -1
  11. package/dist/node/devices/absolutemotor.js +6 -2
  12. package/dist/node/devices/absolutemotor.js.map +1 -1
  13. package/dist/node/devices/basicmotor.js +5 -1
  14. package/dist/node/devices/basicmotor.js.map +1 -1
  15. package/dist/node/devices/colordistancesensor.js +7 -3
  16. package/dist/node/devices/colordistancesensor.js.map +1 -1
  17. package/dist/node/devices/currentsensor.js +6 -2
  18. package/dist/node/devices/currentsensor.js.map +1 -1
  19. package/dist/node/devices/device.d.ts +3 -1
  20. package/dist/node/devices/device.js +5 -1
  21. package/dist/node/devices/device.js.map +1 -1
  22. package/dist/node/devices/duplotrainbasecolorsensor.js +6 -2
  23. package/dist/node/devices/duplotrainbasecolorsensor.js.map +1 -1
  24. package/dist/node/devices/duplotrainbasemotor.js +5 -1
  25. package/dist/node/devices/duplotrainbasemotor.js.map +1 -1
  26. package/dist/node/devices/duplotrainbasespeaker.js +6 -2
  27. package/dist/node/devices/duplotrainbasespeaker.js.map +1 -1
  28. package/dist/node/devices/duplotrainbasespeedometer.js +6 -2
  29. package/dist/node/devices/duplotrainbasespeedometer.js.map +1 -1
  30. package/dist/node/devices/hubled.js +6 -2
  31. package/dist/node/devices/hubled.js.map +1 -1
  32. package/dist/node/devices/light.js +5 -1
  33. package/dist/node/devices/light.js.map +1 -1
  34. package/dist/node/devices/marioaccelerometer.js +6 -2
  35. package/dist/node/devices/marioaccelerometer.js.map +1 -1
  36. package/dist/node/devices/mariobarcodesensor.js +6 -2
  37. package/dist/node/devices/mariobarcodesensor.js.map +1 -1
  38. package/dist/node/devices/mariopantssensor.js +6 -2
  39. package/dist/node/devices/mariopantssensor.js.map +1 -1
  40. package/dist/node/devices/mediumlinearmotor.js +5 -1
  41. package/dist/node/devices/mediumlinearmotor.js.map +1 -1
  42. package/dist/node/devices/motionsensor.js +6 -2
  43. package/dist/node/devices/motionsensor.js.map +1 -1
  44. package/dist/node/devices/movehubmediumlinearmotor.js +5 -1
  45. package/dist/node/devices/movehubmediumlinearmotor.js.map +1 -1
  46. package/dist/node/devices/movehubtiltsensor.js +6 -2
  47. package/dist/node/devices/movehubtiltsensor.js.map +1 -1
  48. package/dist/node/devices/piezobuzzer.js +5 -1
  49. package/dist/node/devices/piezobuzzer.js.map +1 -1
  50. package/dist/node/devices/remotecontrolbutton.js +7 -3
  51. package/dist/node/devices/remotecontrolbutton.js.map +1 -1
  52. package/dist/node/devices/simplemediumlinearmotor.js +5 -1
  53. package/dist/node/devices/simplemediumlinearmotor.js.map +1 -1
  54. package/dist/node/devices/tachomotor.js +6 -2
  55. package/dist/node/devices/tachomotor.js.map +1 -1
  56. package/dist/node/devices/technic3x3colorlightmatrix.js +6 -2
  57. package/dist/node/devices/technic3x3colorlightmatrix.js.map +1 -1
  58. package/dist/node/devices/techniccolorsensor.js +6 -2
  59. package/dist/node/devices/techniccolorsensor.js.map +1 -1
  60. package/dist/node/devices/technicdistancesensor.js +6 -2
  61. package/dist/node/devices/technicdistancesensor.js.map +1 -1
  62. package/dist/node/devices/technicforcesensor.js +6 -2
  63. package/dist/node/devices/technicforcesensor.js.map +1 -1
  64. package/dist/node/devices/techniclargeangularmotor.js +5 -1
  65. package/dist/node/devices/techniclargeangularmotor.js.map +1 -1
  66. package/dist/node/devices/techniclargelinearmotor.js +5 -1
  67. package/dist/node/devices/techniclargelinearmotor.js.map +1 -1
  68. package/dist/node/devices/technicmediumangularmotor.js +5 -1
  69. package/dist/node/devices/technicmediumangularmotor.js.map +1 -1
  70. package/dist/node/devices/technicmediumhubaccelerometersensor.js +6 -2
  71. package/dist/node/devices/technicmediumhubaccelerometersensor.js.map +1 -1
  72. package/dist/node/devices/technicmediumhubgyrosensor.js +6 -2
  73. package/dist/node/devices/technicmediumhubgyrosensor.js.map +1 -1
  74. package/dist/node/devices/technicmediumhubtiltsensor.js +7 -3
  75. package/dist/node/devices/technicmediumhubtiltsensor.js.map +1 -1
  76. package/dist/node/devices/technicsmallangularmotor.js +5 -1
  77. package/dist/node/devices/technicsmallangularmotor.js.map +1 -1
  78. package/dist/node/devices/technicxlargelinearmotor.js +5 -1
  79. package/dist/node/devices/technicxlargelinearmotor.js.map +1 -1
  80. package/dist/node/devices/tiltsensor.js +6 -2
  81. package/dist/node/devices/tiltsensor.js.map +1 -1
  82. package/dist/node/devices/trainmotor.js +5 -1
  83. package/dist/node/devices/trainmotor.js.map +1 -1
  84. package/dist/node/devices/voltagesensor.js +6 -2
  85. package/dist/node/devices/voltagesensor.js.map +1 -1
  86. package/dist/node/hubs/basehub.d.ts +1 -0
  87. package/dist/node/hubs/basehub.js +5 -1
  88. package/dist/node/hubs/basehub.js.map +1 -1
  89. package/dist/node/hubs/duplotrainbase.d.ts +1 -0
  90. package/dist/node/hubs/duplotrainbase.js +5 -1
  91. package/dist/node/hubs/duplotrainbase.js.map +1 -1
  92. package/dist/node/hubs/hub.d.ts +1 -0
  93. package/dist/node/hubs/hub.js +12 -11
  94. package/dist/node/hubs/hub.js.map +1 -1
  95. package/dist/node/hubs/lpf2hub.js +5 -1
  96. package/dist/node/hubs/lpf2hub.js.map +1 -1
  97. package/dist/node/hubs/mario.d.ts +1 -0
  98. package/dist/node/hubs/mario.js +5 -1
  99. package/dist/node/hubs/mario.js.map +1 -1
  100. package/dist/node/hubs/movehub.d.ts +1 -0
  101. package/dist/node/hubs/movehub.js +7 -6
  102. package/dist/node/hubs/movehub.js.map +1 -1
  103. package/dist/node/hubs/remotecontrol.d.ts +1 -0
  104. package/dist/node/hubs/remotecontrol.js +5 -1
  105. package/dist/node/hubs/remotecontrol.js.map +1 -1
  106. package/dist/node/hubs/technicmediumhub.d.ts +1 -0
  107. package/dist/node/hubs/technicmediumhub.js +5 -1
  108. package/dist/node/hubs/technicmediumhub.js.map +1 -1
  109. package/dist/node/hubs/technicsmallhub.d.ts +1 -0
  110. package/dist/node/hubs/technicsmallhub.js +10 -6
  111. package/dist/node/hubs/technicsmallhub.js.map +1 -1
  112. package/dist/node/hubs/wedo2smarthub.d.ts +1 -0
  113. package/dist/node/hubs/wedo2smarthub.js +10 -6
  114. package/dist/node/hubs/wedo2smarthub.js.map +1 -1
  115. package/dist/node/index-browser.js +5 -1
  116. package/dist/node/index-browser.js.map +1 -1
  117. package/dist/node/index-node.js +5 -1
  118. package/dist/node/index-node.js.map +1 -1
  119. package/dist/node/interfaces.d.ts +1 -0
  120. package/dist/node/nobleabstraction.d.ts +1 -0
  121. package/dist/node/nobleabstraction.js.map +1 -1
  122. package/dist/node/poweredup-browser.js +10 -3
  123. package/dist/node/poweredup-browser.js.map +1 -1
  124. package/dist/node/poweredup-node.js +5 -3
  125. package/dist/node/poweredup-node.js.map +1 -1
  126. package/dist/node/utils.d.ts +2 -1
  127. package/dist/node/utils.js.map +1 -1
  128. package/dist/node/webbleabstraction.d.ts +2 -1
  129. package/dist/node/webbleabstraction.js +1 -1
  130. package/dist/node/webbleabstraction.js.map +1 -1
  131. package/docs/AbsoluteMotor.html +1037 -1066
  132. package/docs/BaseHub.html +622 -807
  133. package/docs/BasicMotor.html +707 -809
  134. package/docs/ColorDistanceSensor.html +1500 -1611
  135. package/docs/CurrentSensor.html +470 -623
  136. package/docs/Device.html +372 -502
  137. package/docs/DuploTrainBase.html +1004 -1225
  138. package/docs/DuploTrainBaseColorSensor.html +712 -874
  139. package/docs/DuploTrainBaseMotor.html +723 -841
  140. package/docs/DuploTrainBaseSpeaker.html +565 -693
  141. package/docs/DuploTraniBaseSpeedometer.html +396 -550
  142. package/docs/Hub.html +3842 -3987
  143. package/docs/HubLED.html +591 -731
  144. package/docs/LPF2Hub.html +983 -1188
  145. package/docs/Light.html +591 -731
  146. package/docs/Mario.html +1004 -1225
  147. package/docs/MarioAccelerometer.html +568 -732
  148. package/docs/MarioBarcodeSensor.html +568 -732
  149. package/docs/MarioPantsSensor.html +470 -623
  150. package/docs/MediumLinearMotor.html +679 -748
  151. package/docs/MotionSensor.html +470 -623
  152. package/docs/MoveHub.html +1004 -1225
  153. package/docs/MoveHubMediumLinearMotor.html +679 -748
  154. package/docs/MoveHubTiltSensor.html +483 -642
  155. package/docs/PiezoBuzzer.html +495 -642
  156. package/docs/PoweredUP.html +2223 -2174
  157. package/docs/RemoteControl.html +1004 -1225
  158. package/docs/RemoteControlButton.html +470 -623
  159. package/docs/SimpleMediumLinearMotor.html +396 -550
  160. package/docs/TachoMotor.html +1298 -1393
  161. package/docs/Technic3x3ColorLightMatrix.html +484 -628
  162. package/docs/TechnicColorSensor.html +726 -876
  163. package/docs/TechnicDistanceSensor.html +667 -824
  164. package/docs/TechnicForceSensor.html +614 -765
  165. package/docs/TechnicLargeAngularMotor.html +1046 -1091
  166. package/docs/TechnicLargeLinearMotor.html +1046 -1091
  167. package/docs/TechnicMediumAngularMotor.html +1046 -1091
  168. package/docs/TechnicMediumHub.html +1004 -1225
  169. package/docs/TechnicMediumHubAccelerometerSensor.html +496 -661
  170. package/docs/TechnicMediumHubGyroSensor.html +496 -661
  171. package/docs/TechnicMediumHubTiltSensor.html +820 -945
  172. package/docs/TechnicSmallAngularMotor.html +1046 -1091
  173. package/docs/TechnicXLargeLinearMotor.html +1046 -1091
  174. package/docs/TiltSensor.html +483 -642
  175. package/docs/TrainMotor.html +723 -841
  176. package/docs/VoltageSensor.html +470 -623
  177. package/docs/WeDo2SmartHub.html +890 -1102
  178. package/docs/consts.js.html +53 -116
  179. package/docs/devices_absolutemotor.js.html +35 -94
  180. package/docs/devices_basicmotor.js.html +34 -93
  181. package/docs/devices_colordistancesensor.js.html +33 -92
  182. package/docs/devices_currentsensor.js.html +35 -94
  183. package/docs/devices_device.js.html +32 -91
  184. package/docs/devices_duplotrainbasecolorsensor.js.html +35 -94
  185. package/docs/devices_duplotrainbasemotor.js.html +34 -93
  186. package/docs/devices_duplotrainbasespeaker.js.html +35 -94
  187. package/docs/devices_duplotrainbasespeedometer.js.html +35 -94
  188. package/docs/devices_hubled.js.html +35 -94
  189. package/docs/devices_light.js.html +34 -93
  190. package/docs/devices_marioaccelerometer.js.html +35 -94
  191. package/docs/devices_mariobarcodesensor.js.html +35 -94
  192. package/docs/devices_mariopantssensor.js.html +35 -94
  193. package/docs/devices_mediumlinearmotor.js.html +34 -93
  194. package/docs/devices_motionsensor.js.html +35 -94
  195. package/docs/devices_movehubmediumlinearmotor.js.html +34 -93
  196. package/docs/devices_movehubtiltsensor.js.html +35 -94
  197. package/docs/devices_piezobuzzer.js.html +34 -93
  198. package/docs/devices_remotecontrolbutton.js.html +36 -95
  199. package/docs/devices_simplemediumlinearmotor.js.html +34 -93
  200. package/docs/devices_tachomotor.js.html +33 -92
  201. package/docs/devices_technic3x3colorlightmatrix.js.html +35 -94
  202. package/docs/devices_techniccolorsensor.js.html +35 -94
  203. package/docs/devices_technicdistancesensor.js.html +35 -94
  204. package/docs/devices_technicforcesensor.js.html +35 -94
  205. package/docs/devices_techniclargeangularmotor.js.html +34 -93
  206. package/docs/devices_techniclargelinearmotor.js.html +34 -93
  207. package/docs/devices_technicmediumangularmotor.js.html +34 -93
  208. package/docs/devices_technicmediumhubaccelerometersensor.js.html +35 -94
  209. package/docs/devices_technicmediumhubgyrosensor.js.html +35 -94
  210. package/docs/devices_technicmediumhubtiltsensor.js.html +36 -95
  211. package/docs/devices_technicsmallangularmotor.js.html +34 -93
  212. package/docs/devices_technicxlargelinearmotor.js.html +34 -93
  213. package/docs/devices_tiltsensor.js.html +35 -94
  214. package/docs/devices_trainmotor.js.html +34 -93
  215. package/docs/devices_voltagesensor.js.html +35 -94
  216. package/docs/global.html +2094 -7927
  217. package/docs/hubs_basehub.js.html +31 -90
  218. package/docs/hubs_duplotrainbase.js.html +34 -93
  219. package/docs/hubs_hub.js.html +41 -103
  220. package/docs/hubs_lpf2hub.js.html +31 -90
  221. package/docs/hubs_mario.js.html +34 -93
  222. package/docs/hubs_movehub.js.html +36 -98
  223. package/docs/hubs_remotecontrol.js.html +34 -93
  224. package/docs/hubs_technicmediumhub.js.html +34 -93
  225. package/docs/hubs_technicsmallhub.js.html +39 -98
  226. package/docs/hubs_wedo2smarthub.js.html +36 -95
  227. package/docs/index.html +36 -83
  228. package/docs/poweredup-browser.js.html +36 -92
  229. package/docs/poweredup-node.js.html +32 -93
  230. package/docs/scripts/linenumber.js +21 -19
  231. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  232. package/docs/scripts/prettify/lang-css.js +2 -0
  233. package/docs/scripts/prettify/prettify.js +28 -0
  234. package/docs/styles/jsdoc-default.css +192 -787
  235. package/docs/styles/prettify-jsdoc.css +1 -1
  236. package/docs/styles/prettify-tomorrow.css +8 -14
  237. package/package.json +13 -13
  238. package/src/devices/device.ts +2 -2
  239. package/src/devices/remotecontrolbutton.ts +1 -1
  240. package/src/devices/technicmediumhubtiltsensor.ts +1 -1
  241. package/src/hubs/hub.ts +2 -2
  242. package/src/hubs/movehub.ts +2 -2
  243. package/src/poweredup-browser.ts +5 -2
  244. package/src/poweredup-node.ts +0 -2
  245. package/src/webbleabstraction.ts +2 -2
  246. package/jsdoc-template/braintree/CHANGELOG.md +0 -31
  247. package/jsdoc-template/braintree/LICENSE +0 -27
  248. package/jsdoc-template/braintree/README.md +0 -90
  249. package/jsdoc-template/braintree/package.json +0 -39
  250. package/jsdoc-template/braintree/publish.js +0 -675
  251. package/jsdoc-template/braintree/static/fonts/OpenSans-Bold-webfont.eot +0 -0
  252. package/jsdoc-template/braintree/static/fonts/OpenSans-Bold-webfont.svg +0 -1830
  253. package/jsdoc-template/braintree/static/fonts/OpenSans-Bold-webfont.woff +0 -0
  254. package/jsdoc-template/braintree/static/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  255. package/jsdoc-template/braintree/static/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  256. package/jsdoc-template/braintree/static/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  257. package/jsdoc-template/braintree/static/fonts/OpenSans-Italic-webfont.eot +0 -0
  258. package/jsdoc-template/braintree/static/fonts/OpenSans-Italic-webfont.svg +0 -1830
  259. package/jsdoc-template/braintree/static/fonts/OpenSans-Italic-webfont.woff +0 -0
  260. package/jsdoc-template/braintree/static/fonts/OpenSans-Light-webfont.eot +0 -0
  261. package/jsdoc-template/braintree/static/fonts/OpenSans-Light-webfont.svg +0 -1831
  262. package/jsdoc-template/braintree/static/fonts/OpenSans-Light-webfont.woff +0 -0
  263. package/jsdoc-template/braintree/static/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  264. package/jsdoc-template/braintree/static/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  265. package/jsdoc-template/braintree/static/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  266. package/jsdoc-template/braintree/static/fonts/OpenSans-Regular-webfont.eot +0 -0
  267. package/jsdoc-template/braintree/static/fonts/OpenSans-Regular-webfont.svg +0 -1831
  268. package/jsdoc-template/braintree/static/fonts/OpenSans-Regular-webfont.woff +0 -0
  269. package/jsdoc-template/braintree/static/fonts/OpenSans-Semibold-webfont.eot +0 -0
  270. package/jsdoc-template/braintree/static/fonts/OpenSans-Semibold-webfont.svg +0 -1830
  271. package/jsdoc-template/braintree/static/fonts/OpenSans-Semibold-webfont.ttf +0 -0
  272. package/jsdoc-template/braintree/static/fonts/OpenSans-Semibold-webfont.woff +0 -0
  273. package/jsdoc-template/braintree/static/fonts/OpenSans-SemiboldItalic-webfont.eot +0 -0
  274. package/jsdoc-template/braintree/static/fonts/OpenSans-SemiboldItalic-webfont.svg +0 -1830
  275. package/jsdoc-template/braintree/static/fonts/OpenSans-SemiboldItalic-webfont.ttf +0 -0
  276. package/jsdoc-template/braintree/static/fonts/OpenSans-SemiboldItalic-webfont.woff +0 -0
  277. package/jsdoc-template/braintree/static/icons/home.svg +0 -4
  278. package/jsdoc-template/braintree/static/icons/search.svg +0 -4
  279. package/jsdoc-template/braintree/static/scripts/linenumber.js +0 -23
  280. package/jsdoc-template/braintree/static/scripts/pagelocation.js +0 -89
  281. package/jsdoc-template/braintree/static/styles/collapse.css +0 -27
  282. package/jsdoc-template/braintree/static/styles/jsdoc-default.css +0 -953
  283. package/jsdoc-template/braintree/static/styles/prettify-jsdoc.css +0 -111
  284. package/jsdoc-template/braintree/static/styles/prettify-tomorrow.css +0 -138
  285. package/jsdoc-template/braintree/tmpl/augments.tmpl +0 -10
  286. package/jsdoc-template/braintree/tmpl/container.tmpl +0 -213
  287. package/jsdoc-template/braintree/tmpl/details.tmpl +0 -223
  288. package/jsdoc-template/braintree/tmpl/example.tmpl +0 -2
  289. package/jsdoc-template/braintree/tmpl/examples.tmpl +0 -14
  290. package/jsdoc-template/braintree/tmpl/exceptions.tmpl +0 -28
  291. package/jsdoc-template/braintree/tmpl/layout.tmpl +0 -150
  292. package/jsdoc-template/braintree/tmpl/mainpage.tmpl +0 -9
  293. package/jsdoc-template/braintree/tmpl/members.tmpl +0 -38
  294. package/jsdoc-template/braintree/tmpl/method.tmpl +0 -128
  295. package/jsdoc-template/braintree/tmpl/params.tmpl +0 -125
  296. package/jsdoc-template/braintree/tmpl/properties.tmpl +0 -111
  297. package/jsdoc-template/braintree/tmpl/returns.tmpl +0 -17
  298. package/jsdoc-template/braintree/tmpl/source.tmpl +0 -9
  299. package/jsdoc-template/braintree/tmpl/tutorial.tmpl +0 -23
  300. package/jsdoc-template/braintree/tmpl/type.tmpl +0 -11
@@ -9,7 +9,7 @@
9
9
 
10
10
  /* string content */
11
11
  .str {
12
- color: hsl(104, 100%, 24%);
12
+ color: #006400;
13
13
  font-weight: normal;
14
14
  font-style: normal;
15
15
  }
@@ -9,35 +9,35 @@
9
9
  @media screen {
10
10
  /* string content */
11
11
  .str {
12
- color: hsl(104, 100%, 24%); }
12
+ color: #718c00; }
13
13
 
14
14
  /* a keyword */
15
15
  .kwd {
16
- color: hsl(240, 100%, 50%); }
16
+ color: #8959a8; }
17
17
 
18
18
  /* a comment */
19
19
  .com {
20
- color: hsl(0, 0%, 60%); }
20
+ color: #8e908c; }
21
21
 
22
22
  /* a type name */
23
23
  .typ {
24
- color: hsl(240, 100%, 32%); }
24
+ color: #4271ae; }
25
25
 
26
26
  /* a literal value */
27
27
  .lit {
28
- color: hsl(240, 100%, 40%); }
28
+ color: #f5871f; }
29
29
 
30
30
  /* punctuation */
31
31
  .pun {
32
- color: #000000; }
32
+ color: #4d4d4c; }
33
33
 
34
34
  /* lisp open bracket */
35
35
  .opn {
36
- color: #000000; }
36
+ color: #4d4d4c; }
37
37
 
38
38
  /* lisp close bracket */
39
39
  .clo {
40
- color: #000000; }
40
+ color: #4d4d4c; }
41
41
 
42
42
  /* a markup tag name */
43
43
  .tag {
@@ -105,12 +105,6 @@ pre.prettyprint {
105
105
  padding: 10px; }
106
106
  */
107
107
 
108
- /* Get LI elements to show when they are in the main article */
109
- article ul li {
110
- list-style-type: circle;
111
- margin-left: 25px;
112
- }
113
-
114
108
  /* Specify class=linenums on a pre to get line numbering */
115
109
  ol.linenums {
116
110
  margin-top: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-poweredup",
3
- "version": "8.0.4",
3
+ "version": "9.0.0",
4
4
  "description": "A Javascript module to interface with LEGO Powered Up components.",
5
5
  "homepage": "https://github.com/nathankellenicki/node-poweredup/",
6
6
  "main": "dist/node/index-node.js",
@@ -18,21 +18,21 @@
18
18
  "author": "Nathan Kellenicki <nathan@kellenicki.com>",
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@abandonware/noble": "1.9.2-15",
22
- "compare-versions": "^4.1.3",
23
- "debug": "^4.3.3"
21
+ "@abandonware/noble": "1.9.2-24",
22
+ "compare-versions": "^6.1.0",
23
+ "debug": "^4.3.4"
24
24
  },
25
25
  "devDependencies": {
26
- "@types/debug": "4.1.7",
27
- "@types/node": "^17.0.10",
28
- "@types/web-bluetooth": "0.0.12",
26
+ "@types/debug": "4.1.12",
27
+ "@types/node": "^20.12.7",
28
+ "@types/web-bluetooth": "0.0.20",
29
29
  "buffer": "^6.0.3",
30
- "jsdoc": "^3.5.5",
31
- "jsdoc-to-markdown": "^7.1.0",
32
- "ts-loader": "^9.2.6",
30
+ "jsdoc": "^4.0.2",
31
+ "jsdoc-to-markdown": "^8.0.1",
32
+ "ts-loader": "^9.5.1",
33
33
  "tslint": "^6.1.3",
34
- "typescript": "^4.5.4",
35
- "webpack": "^5.66.0",
36
- "webpack-cli": "^4.9.1"
34
+ "typescript": "^5.4.5",
35
+ "webpack": "^5.91.0",
36
+ "webpack-cli": "^5.1.4"
37
37
  }
38
38
  }
@@ -25,7 +25,7 @@ export class Device extends EventEmitter {
25
25
 
26
26
  private _isWeDo2SmartHub: boolean;
27
27
  private _isVirtualPort: boolean = false;
28
- private _eventTimer: NodeJS.Timer | null = null;
28
+ private _eventTimer: NodeJS.Timeout | null = null;
29
29
 
30
30
  constructor (hub: IDeviceInterface, portId: number, modeMap: {[event: string]: number} = {}, type: Consts.DeviceType = Consts.DeviceType.UNKNOWN) {
31
31
  super();
@@ -178,7 +178,7 @@ export class Device extends EventEmitter {
178
178
  }
179
179
  }
180
180
 
181
- public setEventTimer (timer: NodeJS.Timer) {
181
+ public setEventTimer (timer: NodeJS.Timeout) {
182
182
  this._eventTimer = timer;
183
183
  }
184
184
 
@@ -21,7 +21,7 @@ export class RemoteControlButton extends Device {
21
21
  case Mode.BUTTON_EVENTS:
22
22
  /**
23
23
  * Emits when a button on the remote is pressed or released.
24
- * @event RemoteControlButton#button
24
+ * @event RemoteControlButton#remoteButton
25
25
  * @type {object}
26
26
  * @param {number} event
27
27
  */
@@ -57,7 +57,7 @@ export class TechnicMediumHubTiltSensor extends Device {
57
57
  * @type {object}
58
58
  * @param {number} number of impact events.
59
59
  */
60
- this.notify("tiltCount", { count });
60
+ this.notify("impactCount", { count });
61
61
  break;
62
62
  }
63
63
  }
package/src/hubs/hub.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Peripheral } from "@abandonware/noble";
2
- import compareVersion from "compare-versions";
2
+ import { compareVersions } from "compare-versions";
3
3
 
4
4
  import { IBLEAbstraction } from "../interfaces";
5
5
 
@@ -47,7 +47,7 @@ export class Hub extends LPF2Hub {
47
47
 
48
48
 
49
49
  protected _checkFirmware (version: string) {
50
- if (compareVersion("1.1.00.0004", version) === 1) {
50
+ if (compareVersions("1.1.00.0004", version) === 1) {
51
51
  throw new Error(`Your Powered Up Hub's (${this.name}) firmware is out of date and unsupported by this library. Please update it via the official Powered Up app.`);
52
52
  }
53
53
  }
@@ -1,5 +1,5 @@
1
1
  import { Peripheral } from "@abandonware/noble";
2
- import compareVersion from "compare-versions";
2
+ import { compareVersions } from "compare-versions";
3
3
 
4
4
  import { IBLEAbstraction } from "../interfaces";
5
5
 
@@ -45,7 +45,7 @@ export class MoveHub extends LPF2Hub {
45
45
 
46
46
 
47
47
  protected _checkFirmware (version: string) {
48
- if (compareVersion("2.0.00.0017", version) === 1) {
48
+ if (compareVersions("2.0.00.0017", version) === 1) {
49
49
  throw new Error(`Your Move Hub's (${this.name}) firmware is out of date and unsupported by this library. Please update it via the official Powered Up app.`);
50
50
  }
51
51
  }
@@ -130,9 +130,9 @@ export class PoweredUP extends EventEmitter {
130
130
 
131
131
 
132
132
  private _determineLPF2HubType (device: IBLEAbstraction): Promise<Consts.HubType> {
133
- return new Promise((resolve) => {
133
+ return new Promise(async (resolve) => {
134
134
  let buf: Buffer = Buffer.alloc(0);
135
- device.subscribeToCharacteristic(Consts.BLECharacteristic.LPF2_ALL, (data: Buffer) => {
135
+ await device.subscribeToCharacteristic(Consts.BLECharacteristic.LPF2_ALL, (data: Buffer) => {
136
136
  buf = Buffer.concat([buf, data]);
137
137
  while (buf[0] <= buf.length) {
138
138
  const len = buf[0];
@@ -158,6 +158,9 @@ export class PoweredUP extends EventEmitter {
158
158
  case Consts.BLEManufacturerData.TECHNIC_MEDIUM_HUB_ID:
159
159
  resolve(Consts.HubType.TECHNIC_MEDIUM_HUB);
160
160
  break;
161
+ case Consts.BLEManufacturerData.MARIO_ID:
162
+ resolve(Consts.HubType.MARIO);
163
+ break;
161
164
  }
162
165
  debug("Hub type determined");
163
166
  } else {
@@ -72,7 +72,6 @@ export class PoweredUP extends EventEmitter {
72
72
  public async scan () {
73
73
  wantScan = true;
74
74
  // @ts-ignore
75
- noble.removeAllListeners();
76
75
  noble.on("discover", this._discoveryEventHandler);
77
76
 
78
77
  if (ready) {
@@ -91,7 +90,6 @@ export class PoweredUP extends EventEmitter {
91
90
  public stop () {
92
91
  wantScan = false;
93
92
  // @ts-ignore
94
- noble.removeAllListeners();
95
93
  noble.removeListener("discover", this._discoveryEventHandler);
96
94
  noble.stopScanning();
97
95
  }
@@ -85,7 +85,7 @@ export class WebBLEDevice extends EventEmitter implements IBLEAbstraction {
85
85
  }
86
86
 
87
87
 
88
- public subscribeToCharacteristic (uuid: string, callback: (data: Buffer) => void) {
88
+ public subscribeToCharacteristic (uuid: string, callback: (data: Buffer) => void): Promise<any> {
89
89
  if (this._listeners[uuid]) {
90
90
  this._characteristics[uuid].removeEventListener("characteristicvaluechanged", this._listeners[uuid]);
91
91
  }
@@ -108,7 +108,7 @@ export class WebBLEDevice extends EventEmitter implements IBLEAbstraction {
108
108
  callback(data);
109
109
  }
110
110
 
111
- this._characteristics[uuid].startNotifications();
111
+ return this._characteristics[uuid].startNotifications();
112
112
  }
113
113
 
114
114
 
@@ -1,31 +0,0 @@
1
- # CHANGELOG
2
-
3
- ## v3.4.0 (2020-10-15)
4
-
5
- * Added a postprocess function option to template config options
6
-
7
- ## 3.3.0
8
-
9
- * Added support for templates.collapse option. When set to true only the active component\'s members are expanded.
10
- * Added templates.resources option that takes an object where the keys are the labels and the values are links to external resources.
11
- * Minor css bugfixes
12
-
13
- ## 3.2.0
14
-
15
- * Fix issue where all elements would be hidden if no excludePattern is included ([#16] thanks [@mercmobily])
16
- * Display bullet points in documentation ([#17]) thanks [@mercmobily])
17
- * Allow `disableSort` to be included in template to prevent automatic sorting of classes and methods ([#15] thanks [@mercmobily])
18
-
19
- ## 3.1.1
20
-
21
- * Hide hidden modules from members section
22
-
23
- ## 3.1.0
24
-
25
- * Add anchor tags to examples
26
- * Increase max-width of sections
27
-
28
- [@mercmobily]: /mercmobily/
29
- [#15]: /braintree/jsdoc-template/pull/15
30
- [#16]: /braintree/jsdoc-template/pull/16
31
- [#17]: /braintree/jsdoc-template/pull/17
@@ -1,27 +0,0 @@
1
- ## JSDoc 3
2
-
3
- JSDoc 3 is free software, licensed under the Apache License, Version 2.0 (the
4
- "License"). Commercial and non-commercial use are permitted in compliance with
5
- the License.
6
-
7
- Copyright (c) 2011-2015 Michael Mathews <micmath@gmail.com> and the
8
- [contributors to JSDoc](https://github.com/jsdoc3/jsdoc/graphs/contributors).
9
- All rights reserved.
10
-
11
- You may obtain a copy of the License at:
12
- http://www.apache.org/licenses/LICENSE-2.0
13
-
14
- In addition, a copy of the License is included with this distribution.
15
-
16
- As stated in Section 7, "Disclaimer of Warranty," of the License:
17
-
18
- > Licensor provides the Work (and each Contributor provides its Contributions)
19
- > on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
20
- > express or implied, including, without limitation, any warranties or
21
- > conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
22
- > PARTICULAR PURPOSE. You are solely responsible for determining the
23
- > appropriateness of using or redistributing the Work and assume any risks
24
- > associated with Your exercise of permissions under this License.
25
-
26
- The source code for JSDoc 3 is available at:
27
- https://github.com/jsdoc3/jsdoc
@@ -1,90 +0,0 @@
1
- # Braintree JSDoc Template
2
-
3
- A clean, responsive documentation template with search and navigation highlighting for JSDoc 3. Forked from [github.com/nijikokun/minami](https://github.com/nijikokun/minami).
4
-
5
- ![Braintree JS Doc Template Screenshot](https://puu.sh/rWvW0/2831fd69d6.png)
6
-
7
- ## Responsive
8
-
9
- ![Braintree JS Doc Template Screenshot](https://puu.sh/rWvZ6/aee92a4787.png)
10
-
11
- ## Uses
12
-
13
- - [the Taffy Database library](http://taffydb.com/)
14
- - [Underscore Template library](http://documentcloud.github.com/underscore/#template)
15
- - [Algolia DocSearch](https://community.algolia.com/docsearch/)
16
-
17
- ## Usage
18
-
19
- Clone repository to your designated `jsdoc` template directory, then:
20
-
21
-
22
- ### Node.js Dependency
23
-
24
- In your projects `package.json` file add a generate script:
25
-
26
- ```json
27
- "script": {
28
- "generate-docs": "node_modules/.bin/jsdoc --configure .jsdoc.json --verbose"
29
- }
30
- ```
31
-
32
- In your `.jsdoc.json` file, add a template option.
33
-
34
- ```json
35
- "opts": {
36
- "template": "node_modules/jsdoc-template"
37
- }
38
- ```
39
-
40
- ### Example JSDoc Config
41
-
42
- ```json
43
- {
44
- "tags": {
45
- "allowUnknownTags": true,
46
- "dictionaries": ["jsdoc"]
47
- },
48
- "source": {
49
- "include": ["lib", "package.json", "README.md"],
50
- "includePattern": ".js$",
51
- "excludePattern": "(node_modules/|docs)"
52
- },
53
- "plugins": [
54
- "plugins/markdown"
55
- ],
56
- "templates": {
57
- "referenceTitle": "My SDK Name",
58
- "disableSort": false,
59
- "collapse": true,
60
- "resources": {
61
- "google": "https://www.google.com/"
62
- }
63
- },
64
- "opts": {
65
- "destination": "./docs/",
66
- "encoding": "utf8",
67
- "private": true,
68
- "recurse": true,
69
- "template": "./node_modules/jsdoc-template"
70
- }
71
- }
72
- ```
73
-
74
- Note: `referenceTitle` and `disableSort` will affect the output of this theme.
75
-
76
- If you would like to enable [Algolia DocSearch](https://community.algolia.com/docsearch/), you can pass a `search` object into the `templates` object.
77
-
78
- ```json
79
- "templates": {
80
- "search": {
81
- "apiKey": "your-api-key",
82
- "indexName": "Your index name. Defaults to braintree.",
83
- "hitsPerPage": "Number of Results to show. Defaults to 7.",
84
- }
85
- }
86
- ```
87
-
88
- ## License
89
-
90
- Licensed under the Apache2 license.
@@ -1,39 +0,0 @@
1
- {
2
- "name": "jsdoc-template",
3
- "version": "3.4.0",
4
- "description": "Braintree JSDoc 3 Template",
5
- "main": "publish.js",
6
- "files": [
7
- "static",
8
- "tmpl",
9
- "publish.js",
10
- "CHANGELOG.md",
11
- "LICENSE",
12
- "README.md"
13
- ],
14
- "scripts": {
15
- "lint": "eslint .",
16
- "test": "npm run lint",
17
- "preversion": "./scripts/preversion"
18
- },
19
- "repository": {
20
- "type": "git",
21
- "url": "https://github.com/braintree/jsdoc-template"
22
- },
23
- "author": "Braintreeps <code@getbraintree.com>",
24
- "licenses": [
25
- {
26
- "type": "Apache-2.0",
27
- "url": "http://www.apache.org/licenses/LICENSE-2.0"
28
- }
29
- ],
30
- "bugs": {
31
- "url": "https://github.com/braintree/jsdoc-template"
32
- },
33
- "homepage": "https://github.com/braintree/jsdoc-template",
34
- "devDependencies": {
35
- "eslint": "^7.4.0",
36
- "eslint-config-braintree": "^4.0.0",
37
- "taffydb": "^2.7.3"
38
- }
39
- }