node-miio 0.13.0 → 0.15.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 (266) hide show
  1. package/LICENSE.md +25 -0
  2. package/README.md +5 -6
  3. package/dist/lib/connect_to_device.d.ts +2 -2
  4. package/dist/lib/device.d.ts +36 -60
  5. package/dist/lib/device.js +81 -24
  6. package/dist/lib/device.js.map +1 -1
  7. package/dist/lib/device_info.d.ts +1 -1
  8. package/dist/lib/device_info.js.map +1 -1
  9. package/dist/lib/devices/air-monitor.d.ts +8 -2
  10. package/dist/lib/devices/air-monitor.js +6 -3
  11. package/dist/lib/devices/air-monitor.js.map +1 -1
  12. package/dist/lib/devices/air-purifier.d.ts +14 -6
  13. package/dist/lib/devices/air-purifier.js +7 -2
  14. package/dist/lib/devices/air-purifier.js.map +1 -1
  15. package/dist/lib/devices/capabilities/battery-level.d.ts +5 -22
  16. package/dist/lib/devices/capabilities/battery-level.js +6 -5
  17. package/dist/lib/devices/capabilities/battery-level.js.map +1 -1
  18. package/dist/lib/devices/capabilities/buzzer.d.ts +24 -30
  19. package/dist/lib/devices/capabilities/buzzer.js +32 -49
  20. package/dist/lib/devices/capabilities/buzzer.js.map +1 -1
  21. package/dist/lib/devices/capabilities/changeable-led-brightness.d.ts +13 -29
  22. package/dist/lib/devices/capabilities/changeable-led-brightness.js +16 -24
  23. package/dist/lib/devices/capabilities/changeable-led-brightness.js.map +1 -1
  24. package/dist/lib/devices/capabilities/colorable.d.ts +5 -21
  25. package/dist/lib/devices/capabilities/colorable.js +6 -6
  26. package/dist/lib/devices/capabilities/colorable.js.map +1 -1
  27. package/dist/lib/devices/capabilities/device_capability.d.ts +7 -0
  28. package/dist/lib/devices/capabilities/device_capability.js +10 -0
  29. package/dist/lib/devices/capabilities/device_capability.js.map +1 -0
  30. package/dist/lib/devices/capabilities/dimmable.d.ts +5 -21
  31. package/dist/lib/devices/capabilities/dimmable.js +6 -6
  32. package/dist/lib/devices/capabilities/dimmable.js.map +1 -1
  33. package/dist/lib/devices/capabilities/mode.d.ts +5 -21
  34. package/dist/lib/devices/capabilities/mode.js +6 -5
  35. package/dist/lib/devices/capabilities/mode.js.map +1 -1
  36. package/dist/lib/devices/capabilities/power.d.ts +5 -21
  37. package/dist/lib/devices/capabilities/power.js +6 -5
  38. package/dist/lib/devices/capabilities/power.js.map +1 -1
  39. package/dist/lib/devices/capabilities/sensor.d.ts +29 -15
  40. package/dist/lib/devices/capabilities/sensor.js +56 -41
  41. package/dist/lib/devices/capabilities/sensor.js.map +1 -1
  42. package/dist/lib/devices/capabilities/switchable-led.d.ts +13 -29
  43. package/dist/lib/devices/capabilities/switchable-led.js +18 -30
  44. package/dist/lib/devices/capabilities/switchable-led.js.map +1 -1
  45. package/dist/lib/devices/chuangmi.plug.v1.d.ts +10 -29
  46. package/dist/lib/devices/chuangmi.plug.v1.js +39 -31
  47. package/dist/lib/devices/chuangmi.plug.v1.js.map +1 -1
  48. package/dist/lib/devices/eyecare-lamp2.d.ts +29 -59
  49. package/dist/lib/devices/eyecare-lamp2.js +49 -38
  50. package/dist/lib/devices/eyecare-lamp2.js.map +1 -1
  51. package/dist/lib/devices/gateway/controllers.d.ts +60 -0
  52. package/dist/lib/devices/gateway/controllers.js +137 -0
  53. package/dist/lib/devices/gateway/controllers.js.map +1 -0
  54. package/dist/lib/devices/gateway/ctrl_ln1.d.ts +5 -7
  55. package/dist/lib/devices/gateway/ctrl_ln1.js +8 -33
  56. package/dist/lib/devices/gateway/ctrl_ln1.js.map +1 -1
  57. package/dist/lib/devices/gateway/ctrl_ln2.d.ts +5 -7
  58. package/dist/lib/devices/gateway/ctrl_ln2.js +8 -41
  59. package/dist/lib/devices/gateway/ctrl_ln2.js.map +1 -1
  60. package/dist/lib/devices/gateway/ctrl_neutral1.d.ts +5 -7
  61. package/dist/lib/devices/gateway/ctrl_neutral1.js +8 -33
  62. package/dist/lib/devices/gateway/ctrl_neutral1.js.map +1 -1
  63. package/dist/lib/devices/gateway/ctrl_neutral2.d.ts +5 -7
  64. package/dist/lib/devices/gateway/ctrl_neutral2.js +8 -41
  65. package/dist/lib/devices/gateway/ctrl_neutral2.js.map +1 -1
  66. package/dist/lib/devices/gateway/gateway-light.d.ts +27 -0
  67. package/dist/lib/devices/gateway/gateway-light.js +64 -0
  68. package/dist/lib/devices/gateway/gateway-light.js.map +1 -0
  69. package/dist/lib/devices/gateway/light-channel.d.ts +29 -7
  70. package/dist/lib/devices/gateway/light-channel.js +58 -8
  71. package/dist/lib/devices/gateway/light-channel.js.map +1 -1
  72. package/dist/lib/devices/gateway/plug.d.ts +10 -5
  73. package/dist/lib/devices/gateway/plug.js +16 -12
  74. package/dist/lib/devices/gateway/plug.js.map +1 -1
  75. package/dist/lib/devices/gateway/sensors.d.ts +37 -0
  76. package/dist/lib/devices/gateway/sensors.js +86 -0
  77. package/dist/lib/devices/gateway/sensors.js.map +1 -0
  78. package/dist/lib/devices/gateway/subdevice.d.ts +80 -60
  79. package/dist/lib/devices/gateway/subdevice.js +112 -127
  80. package/dist/lib/devices/gateway/subdevice.js.map +1 -1
  81. package/dist/lib/devices/gateway/subdevices.d.ts +6 -49
  82. package/dist/lib/devices/gateway/subdevices.js +27 -15
  83. package/dist/lib/devices/gateway/subdevices.js.map +1 -1
  84. package/dist/lib/devices/gateway/voltage.d.ts +8 -23
  85. package/dist/lib/devices/gateway/voltage.js +11 -12
  86. package/dist/lib/devices/gateway/voltage.js.map +1 -1
  87. package/dist/lib/devices/gateway.d.ts +61 -67
  88. package/dist/lib/devices/gateway.js +127 -111
  89. package/dist/lib/devices/gateway.js.map +1 -1
  90. package/dist/lib/devices/humidifier.d.ts +23 -10
  91. package/dist/lib/devices/humidifier.js +33 -36
  92. package/dist/lib/devices/humidifier.js.map +1 -1
  93. package/dist/lib/devices/philips-light-bulb.d.ts +14 -6
  94. package/dist/lib/devices/philips-light-bulb.js +23 -21
  95. package/dist/lib/devices/philips-light-bulb.js.map +1 -1
  96. package/dist/lib/devices/power-plug.d.ts +9 -28
  97. package/dist/lib/devices/power-plug.js +15 -8
  98. package/dist/lib/devices/power-plug.js.map +1 -1
  99. package/dist/lib/devices/power-strip.d.ts +11 -5
  100. package/dist/lib/devices/power-strip.js +17 -9
  101. package/dist/lib/devices/power-strip.js.map +1 -1
  102. package/dist/lib/devices/vacuums/dreamevacuum.d.ts +3 -24
  103. package/dist/lib/devices/vacuums/dreamevacuum.js +14 -11
  104. package/dist/lib/devices/vacuums/dreamevacuum.js.map +1 -1
  105. package/dist/lib/devices/vacuums/miot-vacuum.d.ts +23 -30
  106. package/dist/lib/devices/vacuums/miot-vacuum.js +302 -46
  107. package/dist/lib/devices/vacuums/miot-vacuum.js.map +1 -1
  108. package/dist/lib/devices/vacuums/vacuum.d.ts +3 -24
  109. package/dist/lib/devices/vacuums/vacuum.js +6 -5
  110. package/dist/lib/devices/vacuums/vacuum.js.map +1 -1
  111. package/dist/lib/devices/vacuums/vacuum_device.d.ts +1 -1
  112. package/dist/lib/devices/vacuums/vacuum_device.js +3 -3
  113. package/dist/lib/devices/vacuums/vacuum_device.js.map +1 -1
  114. package/dist/lib/devices/vacuums/vacuum_errors.d.ts +4 -3
  115. package/dist/lib/devices/vacuums/vacuum_errors.js +5 -7
  116. package/dist/lib/devices/vacuums/vacuum_errors.js.map +1 -1
  117. package/dist/lib/devices/vacuums/vacuum_states.d.ts +59 -1
  118. package/dist/lib/devices/vacuums/vacuum_states.js +61 -3
  119. package/dist/lib/devices/vacuums/vacuum_states.js.map +1 -1
  120. package/dist/lib/devices/vacuums/vacuum_thing.d.ts +13 -0
  121. package/dist/lib/devices/vacuums/vacuum_thing.js +19 -0
  122. package/dist/lib/devices/vacuums/vacuum_thing.js.map +1 -0
  123. package/dist/lib/devices/vacuums/viomivacuum.d.ts +3 -24
  124. package/dist/lib/devices/vacuums/viomivacuum.js +6 -5
  125. package/dist/lib/devices/vacuums/viomivacuum.js.map +1 -1
  126. package/dist/lib/devices/yeelight.color.d.ts +13 -2
  127. package/dist/lib/devices/yeelight.color.js +101 -3
  128. package/dist/lib/devices/yeelight.color.js.map +1 -1
  129. package/dist/lib/devices/yeelight.d.ts +36 -154
  130. package/dist/lib/devices/yeelight.js +36 -144
  131. package/dist/lib/devices/yeelight.js.map +1 -1
  132. package/dist/lib/devices/yeelight.mono.d.ts +13 -2
  133. package/dist/lib/devices/yeelight.mono.js +34 -3
  134. package/dist/lib/devices/yeelight.mono.js.map +1 -1
  135. package/dist/lib/discovery.js +2 -2
  136. package/dist/lib/discovery.js.map +1 -1
  137. package/dist/lib/events.d.ts +1 -1
  138. package/dist/lib/index.d.ts +1 -6
  139. package/dist/lib/index.js +4 -1
  140. package/dist/lib/index.js.map +1 -1
  141. package/dist/lib/models.d.ts +26 -239
  142. package/dist/lib/models.js +26 -29
  143. package/dist/lib/models.js.map +1 -1
  144. package/dist/lib/protocol.d.ts +10 -2
  145. package/dist/lib/things/capabilities/actions.d.ts +21 -0
  146. package/dist/lib/things/capabilities/actions.js +36 -0
  147. package/dist/lib/things/capabilities/actions.js.map +1 -0
  148. package/dist/lib/things/capabilities/battery-level.d.ts +13 -0
  149. package/dist/lib/things/capabilities/battery-level.js +26 -0
  150. package/dist/lib/things/capabilities/battery-level.js.map +1 -0
  151. package/dist/lib/things/capabilities/charging.d.ts +20 -0
  152. package/dist/lib/things/capabilities/charging.js +40 -0
  153. package/dist/lib/things/capabilities/charging.js.map +1 -0
  154. package/dist/lib/things/capabilities/children.d.ts +78 -0
  155. package/dist/lib/things/capabilities/children.js +173 -0
  156. package/dist/lib/things/capabilities/children.js.map +1 -0
  157. package/dist/lib/things/capabilities/cleaning.d.ts +40 -0
  158. package/dist/lib/things/capabilities/cleaning.js +85 -0
  159. package/dist/lib/things/capabilities/cleaning.js.map +1 -0
  160. package/dist/lib/things/capabilities/error-state.d.ts +15 -0
  161. package/dist/lib/things/capabilities/error-state.js +33 -0
  162. package/dist/lib/things/capabilities/error-state.js.map +1 -0
  163. package/dist/lib/things/capabilities/fan-speed.d.ts +36 -0
  164. package/dist/lib/things/capabilities/fan-speed.js +59 -0
  165. package/dist/lib/things/capabilities/fan-speed.js.map +1 -0
  166. package/dist/lib/things/capabilities/index.d.ts +14 -0
  167. package/dist/lib/things/capabilities/index.js +31 -0
  168. package/dist/lib/things/capabilities/index.js.map +1 -0
  169. package/dist/lib/things/capabilities/lights/brightness.d.ts +44 -0
  170. package/dist/lib/things/capabilities/lights/brightness.js +87 -0
  171. package/dist/lib/things/capabilities/lights/brightness.js.map +1 -0
  172. package/dist/lib/things/capabilities/lights/color-temperature.d.ts +21 -0
  173. package/dist/lib/things/capabilities/lights/color-temperature.js +43 -0
  174. package/dist/lib/things/capabilities/lights/color-temperature.js.map +1 -0
  175. package/dist/lib/things/capabilities/lights/colorable.d.ts +37 -0
  176. package/dist/lib/things/capabilities/lights/colorable.js +57 -0
  177. package/dist/lib/things/capabilities/lights/colorable.js.map +1 -0
  178. package/dist/lib/things/capabilities/lights/fading.d.ts +13 -0
  179. package/dist/lib/things/capabilities/lights/fading.js +23 -0
  180. package/dist/lib/things/capabilities/lights/fading.js.map +1 -0
  181. package/dist/lib/things/capabilities/lights/index.d.ts +5 -0
  182. package/dist/lib/things/capabilities/lights/index.js +22 -0
  183. package/dist/lib/things/capabilities/lights/index.js.map +1 -0
  184. package/dist/lib/things/capabilities/lights/light.d.ts +25 -0
  185. package/dist/lib/things/capabilities/lights/light.js +23 -0
  186. package/dist/lib/things/capabilities/lights/light.js.map +1 -0
  187. package/dist/lib/things/capabilities/mode.d.ts +45 -0
  188. package/dist/lib/things/capabilities/mode.js +75 -0
  189. package/dist/lib/things/capabilities/mode.js.map +1 -0
  190. package/dist/lib/things/capabilities/nameable.d.ts +18 -0
  191. package/dist/lib/things/capabilities/nameable.js +28 -0
  192. package/dist/lib/things/capabilities/nameable.js.map +1 -0
  193. package/dist/lib/things/capabilities/power.d.ts +40 -0
  194. package/dist/lib/things/capabilities/power.js +68 -0
  195. package/dist/lib/things/capabilities/power.js.map +1 -0
  196. package/dist/lib/things/capabilities/sensors.d.ts +91 -0
  197. package/dist/lib/things/capabilities/sensors.js +198 -0
  198. package/dist/lib/things/capabilities/sensors.js.map +1 -0
  199. package/dist/lib/things/capabilities/target-humidity.d.ts +36 -0
  200. package/dist/lib/things/capabilities/target-humidity.js +59 -0
  201. package/dist/lib/things/capabilities/target-humidity.js.map +1 -0
  202. package/dist/lib/things/capability.d.ts +24 -0
  203. package/dist/lib/things/capability.js +21 -0
  204. package/dist/lib/things/capability.js.map +1 -0
  205. package/dist/lib/things/color.d.ts +66 -0
  206. package/dist/lib/things/color.js +303 -0
  207. package/dist/lib/things/color.js.map +1 -0
  208. package/dist/lib/things/compose.d.ts +25 -0
  209. package/dist/lib/things/compose.js +105 -0
  210. package/dist/lib/things/compose.js.map +1 -0
  211. package/dist/lib/things/index.d.ts +14 -0
  212. package/dist/lib/things/index.js +39 -0
  213. package/dist/lib/things/index.js.map +1 -0
  214. package/dist/lib/things/registry.d.ts +19 -0
  215. package/dist/lib/things/registry.js +18 -0
  216. package/dist/lib/things/registry.js.map +1 -0
  217. package/dist/lib/things/thing.d.ts +110 -0
  218. package/dist/lib/things/thing.js +325 -0
  219. package/dist/lib/things/thing.js.map +1 -0
  220. package/dist/lib/things/values.d.ts +123 -0
  221. package/dist/lib/things/values.js +258 -0
  222. package/dist/lib/things/values.js.map +1 -0
  223. package/docs/devices/vacuum.md +1 -2
  224. package/package.json +13 -5
  225. package/snapshots/vacuum-specs.json.gz +0 -0
  226. package/dist/lib/devices/gateway/86sw1.d.ts +0 -7
  227. package/dist/lib/devices/gateway/86sw1.js +0 -20
  228. package/dist/lib/devices/gateway/86sw1.js.map +0 -1
  229. package/dist/lib/devices/gateway/86sw2.d.ts +0 -7
  230. package/dist/lib/devices/gateway/86sw2.js +0 -36
  231. package/dist/lib/devices/gateway/86sw2.js.map +0 -1
  232. package/dist/lib/devices/gateway/cube.d.ts +0 -6
  233. package/dist/lib/devices/gateway/cube.js +0 -49
  234. package/dist/lib/devices/gateway/cube.js.map +0 -1
  235. package/dist/lib/devices/gateway/light-mixin.d.ts +0 -2
  236. package/dist/lib/devices/gateway/light-mixin.js +0 -59
  237. package/dist/lib/devices/gateway/light-mixin.js.map +0 -1
  238. package/dist/lib/devices/gateway/magnet.d.ts +0 -6
  239. package/dist/lib/devices/gateway/magnet.js +0 -23
  240. package/dist/lib/devices/gateway/magnet.js.map +0 -1
  241. package/dist/lib/devices/gateway/magnet2.d.ts +0 -5
  242. package/dist/lib/devices/gateway/magnet2.js +0 -9
  243. package/dist/lib/devices/gateway/magnet2.js.map +0 -1
  244. package/dist/lib/devices/gateway/motion.d.ts +0 -6
  245. package/dist/lib/devices/gateway/motion.js +0 -21
  246. package/dist/lib/devices/gateway/motion.js.map +0 -1
  247. package/dist/lib/devices/gateway/motion2.d.ts +0 -6
  248. package/dist/lib/devices/gateway/motion2.js +0 -25
  249. package/dist/lib/devices/gateway/motion2.js.map +0 -1
  250. package/dist/lib/devices/gateway/sensor_ht.d.ts +0 -5
  251. package/dist/lib/devices/gateway/sensor_ht.js +0 -13
  252. package/dist/lib/devices/gateway/sensor_ht.js.map +0 -1
  253. package/dist/lib/devices/gateway/switch.d.ts +0 -6
  254. package/dist/lib/devices/gateway/switch.js +0 -24
  255. package/dist/lib/devices/gateway/switch.js.map +0 -1
  256. package/dist/lib/devices/gateway/switch2.d.ts +0 -6
  257. package/dist/lib/devices/gateway/switch2.js +0 -19
  258. package/dist/lib/devices/gateway/switch2.js.map +0 -1
  259. package/dist/lib/devices/gateway/weather.d.ts +0 -5
  260. package/dist/lib/devices/gateway/weather.js +0 -16
  261. package/dist/lib/devices/gateway/weather.js.map +0 -1
  262. package/dist/types/abstract-things/climate/index.d.ts +0 -431
  263. package/dist/types/abstract-things/electricals/index.d.ts +0 -5
  264. package/dist/types/abstract-things/index.d.ts +0 -206
  265. package/dist/types/abstract-things/lights/index.d.ts +0 -14
  266. package/dist/types/abstract-things/values/index.d.ts +0 -12
@@ -1,25 +0,0 @@
1
- "use strict";
2
- const { Motion } = require("abstract-things/sensors");
3
- const { Illuminance } = require("../capabilities/sensor");
4
- const SubDevice = require("./subdevice");
5
- const Voltage = require("./voltage");
6
- /**
7
- * Motion sensing device, emits the event `motion` whenever motion is detected.
8
- */
9
- module.exports = class extends SubDevice.with(Motion, Illuminance, Voltage) {
10
- constructor(parent, info) {
11
- super(parent, info);
12
- this.miioModel = "lumi.motion.aq2";
13
- this.defineProperty("status");
14
- this.defineProperty("lux", {
15
- name: "illuminance",
16
- });
17
- }
18
- _report(data) {
19
- super._report(data);
20
- if (typeof data.status !== "undefined" && data.status === "motion") {
21
- this.updateMotion(true, "1m");
22
- }
23
- }
24
- };
25
- //# sourceMappingURL=motion2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"motion2.js","sourceRoot":"","sources":["../../../../src/lib/devices/gateway/motion2.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAEtD,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAE1D,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACzC,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAErC;;GAEG;AACH,MAAM,CAAC,OAAO,GAAG,KAAM,SAAQ,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC;IACzE,YAAY,MAAM,EAAE,IAAI;QACtB,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAEpB,IAAI,CAAC,SAAS,GAAG,iBAAiB,CAAC;QAEnC,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QAE9B,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE;YACzB,IAAI,EAAE,aAAa;SACpB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,IAAI;QACV,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEpB,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,WAAW,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YACnE,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -1,5 +0,0 @@
1
- export = SensorHT;
2
- declare class SensorHT {
3
- constructor(parent: any, info: any);
4
- miioModel: string;
5
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- const { Temperature, Humidity } = require("../capabilities/sensor");
3
- const SubDevice = require("./subdevice");
4
- const Voltage = require("./voltage");
5
- module.exports = class SensorHT extends (SubDevice.with(Temperature, Humidity, Voltage)) {
6
- constructor(parent, info) {
7
- super(parent, info);
8
- this.miioModel = "lumi.sensor_ht";
9
- this.defineProperty("temperature", (v) => v / 100.0);
10
- this.defineProperty("humidity", (v) => v / 100.0);
11
- }
12
- };
13
- //# sourceMappingURL=sensor_ht.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sensor_ht.js","sourceRoot":"","sources":["../../../../src/lib/devices/gateway/sensor_ht.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAEpE,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACzC,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAErC,MAAM,CAAC,OAAO,GAAG,MAAM,QAAS,SAAQ,CACtC,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,CAC/C;IACC,YAAY,MAAM,EAAE,IAAI;QACtB,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAEpB,IAAI,CAAC,SAAS,GAAG,gBAAgB,CAAC;QAElC,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;IACpD,CAAC;CACF,CAAC"}
@@ -1,6 +0,0 @@
1
- export = Switch;
2
- declare class Switch {
3
- constructor(parent: any, info: any);
4
- miioModel: string;
5
- _report(data: any): void;
6
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- const { Button, Actions } = require("abstract-things/controllers");
3
- const SubDevice = require("./subdevice");
4
- const Voltage = require("./voltage");
5
- module.exports = class Switch extends SubDevice.with(Button, Actions, Voltage) {
6
- constructor(parent, info) {
7
- super(parent, info);
8
- this.miioModel = "lumi.switch";
9
- this.updateActions([
10
- "click",
11
- "double_click",
12
- "long_click_press",
13
- "long_click_release",
14
- ]);
15
- }
16
- _report(data) {
17
- super._report(data);
18
- if (typeof data.status !== "undefined") {
19
- this.debug("Action performed:", data.status);
20
- this.emitAction(data.status);
21
- }
22
- }
23
- };
24
- //# sourceMappingURL=switch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"switch.js","sourceRoot":"","sources":["../../../../src/lib/devices/gateway/switch.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAEnE,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACzC,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAErC,MAAM,CAAC,OAAO,GAAG,MAAM,MAAO,SAAQ,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;IAC5E,YAAY,MAAM,EAAE,IAAI;QACtB,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAEpB,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;QAE/B,IAAI,CAAC,aAAa,CAAC;YACjB,OAAO;YACP,cAAc;YACd,kBAAkB;YAClB,oBAAoB;SACrB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,IAAI;QACV,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEpB,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YACvC,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -1,6 +0,0 @@
1
- export = Switch;
2
- declare class Switch {
3
- constructor(parent: any, info: any);
4
- miioModel: string;
5
- _report(data: any): void;
6
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
- const { Button, Actions } = require("abstract-things/controllers");
3
- const SubDevice = require("./subdevice");
4
- const Voltage = require("./voltage");
5
- module.exports = class Switch extends SubDevice.with(Button, Actions, Voltage) {
6
- constructor(parent, info) {
7
- super(parent, info);
8
- this.miioModel = "lumi.switch.v2";
9
- this.updateActions(["click", "double_click"]);
10
- }
11
- _report(data) {
12
- super._report(data);
13
- if (typeof data.status !== "undefined") {
14
- this.debug("Action performed:", data.status);
15
- this.emitAction(data.status);
16
- }
17
- }
18
- };
19
- //# sourceMappingURL=switch2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"switch2.js","sourceRoot":"","sources":["../../../../src/lib/devices/gateway/switch2.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAEnE,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACzC,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAErC,MAAM,CAAC,OAAO,GAAG,MAAM,MAAO,SAAQ,SAAS,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC;IAC5E,YAAY,MAAM,EAAE,IAAI;QACtB,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAEpB,IAAI,CAAC,SAAS,GAAG,gBAAgB,CAAC;QAElC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,CAAC,IAAI;QACV,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAEpB,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;YACvC,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;CACF,CAAC"}
@@ -1,5 +0,0 @@
1
- export = WeatherSensor;
2
- declare class WeatherSensor {
3
- constructor(parent: any, info: any);
4
- miioModel: string;
5
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- const { Temperature, Humidity, AtmosphericPressure, } = require("../capabilities/sensor");
3
- const SubDevice = require("./subdevice");
4
- const Voltage = require("./voltage");
5
- module.exports = class WeatherSensor extends (SubDevice.with(Temperature, Humidity, AtmosphericPressure, Voltage)) {
6
- constructor(parent, info) {
7
- super(parent, info);
8
- this.miioModel = "lumi.weather";
9
- this.defineProperty("temperature", (v) => v / 100.0);
10
- this.defineProperty("humidity", (v) => v / 100.0);
11
- this.defineProperty("pressure", {
12
- name: "atmosphericPressure",
13
- });
14
- }
15
- };
16
- //# sourceMappingURL=weather.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"weather.js","sourceRoot":"","sources":["../../../../src/lib/devices/gateway/weather.js"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,MAAM,EACJ,WAAW,EACX,QAAQ,EACR,mBAAmB,GACpB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAEtC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;AACzC,MAAM,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AAErC,MAAM,CAAC,OAAO,GAAG,MAAM,aAAc,SAAQ,CAC3C,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,mBAAmB,EAAE,OAAO,CAAC,CACpE;IACC,YAAY,MAAM,EAAE,IAAI;QACtB,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAEpB,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC;QAEhC,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;QAClD,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE;YAC9B,IAAI,EAAE,qBAAqB;SAC5B,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -1,431 +0,0 @@
1
- declare module "abstract-things/climate" {
2
- /** The instance type of a class (or of a constructor type, e.g. a mixin) */
3
- type Proto<T> = T extends abstract new (...args: never[]) => infer I
4
- ? I
5
- : T extends { prototype: infer P }
6
- ? P
7
- : never;
8
-
9
- import { Thing, ErrorState } from "abstract-things";
10
- export class Vacuum extends Thing {
11
- static with<
12
- T1 extends { prototype: unknown },
13
- constructorArgs extends unknown[],
14
- >(t1: T1): new (...args: constructorArgs) => Vacuum & Proto<T1>;
15
-
16
- static with<
17
- T1 extends { prototype: unknown },
18
- T2 extends { prototype: unknown },
19
- constructorArgs extends unknown[],
20
- >(
21
- t1: T1,
22
- t2: T2,
23
- ): new (...args: constructorArgs) => Vacuum & Proto<T1> & Proto<T2>;
24
-
25
- static with<
26
- T1 extends { prototype: unknown },
27
- T2 extends { prototype: unknown },
28
- T3 extends { prototype: unknown },
29
- constructorArgs extends unknown[],
30
- >(
31
- t1: T1,
32
- t2: T2,
33
- t3: T3,
34
- ): new (
35
- ...args: constructorArgs
36
- ) => Vacuum & Proto<T1> & Proto<T2> & Proto<T3>;
37
-
38
- static with<
39
- T1 extends { prototype: unknown },
40
- T2 extends { prototype: unknown },
41
- T3 extends { prototype: unknown },
42
- T4 extends { prototype: unknown },
43
- constructorArgs extends unknown[],
44
- >(
45
- t1: T1,
46
- t2: T2,
47
- t3: T3,
48
- t4: T4,
49
- ): new (
50
- ...args: constructorArgs
51
- ) => Vacuum & Proto<T1> & Proto<T2> & Proto<T3> & Proto<T4>;
52
-
53
- static with<
54
- T1 extends { prototype: unknown },
55
- T2 extends { prototype: unknown },
56
- T3 extends { prototype: unknown },
57
- T4 extends { prototype: unknown },
58
- T5 extends { prototype: unknown },
59
- constructorArgs extends unknown[],
60
- >(
61
- t1: T1,
62
- t2: T2,
63
- t3: T3,
64
- t4: T4,
65
- t5: T5,
66
- ): new (
67
- ...args: constructorArgs
68
- ) => Vacuum & Proto<T1> & Proto<T2> & Proto<T3> & Proto<T4> & Proto<T5>;
69
-
70
- static with<
71
- T1 extends { prototype: unknown },
72
- T2 extends { prototype: unknown },
73
- T3 extends { prototype: unknown },
74
- T4 extends { prototype: unknown },
75
- T5 extends { prototype: unknown },
76
- T6 extends { prototype: unknown },
77
- constructorArgs extends unknown[],
78
- >(
79
- t1: T1,
80
- t2: T2,
81
- t3: T3,
82
- t4: T4,
83
- t5: T5,
84
- t6: T6,
85
- ): new (
86
- ...args: constructorArgs
87
- ) => Vacuum &
88
- Proto<T1> &
89
- Proto<T2> &
90
- Proto<T3> &
91
- Proto<T4> &
92
- Proto<T5> &
93
- Proto<T6>;
94
-
95
- static with<
96
- T1 extends { prototype: unknown },
97
- T2 extends { prototype: unknown },
98
- T3 extends { prototype: unknown },
99
- T4 extends { prototype: unknown },
100
- T5 extends { prototype: unknown },
101
- T6 extends { prototype: unknown },
102
- T7 extends { prototype: unknown },
103
- constructorArgs extends unknown[],
104
- >(
105
- t1: T1,
106
- t2: T2,
107
- t3: T3,
108
- t4: T4,
109
- t5: T5,
110
- t6: T6,
111
- t7: T7,
112
- ): new (
113
- ...args: constructorArgs
114
- ) => Vacuum &
115
- Proto<T1> &
116
- Proto<T2> &
117
- Proto<T3> &
118
- Proto<T4> &
119
- Proto<T5> &
120
- Proto<T6> &
121
- Proto<T7>;
122
- }
123
- export class AdjustableFanSpeed extends Thing {
124
- fanSpeed(): Promise<number>;
125
- updateFanSpeed(speed: unknown): void;
126
- }
127
- export class CleaningState extends ErrorState {
128
- cleaning(): Promise<boolean>;
129
- updateCleaning(cleaning: boolean): void;
130
- }
131
- export class AutonomousCleaning extends CleaningState {}
132
- export class SpotCleaning extends Thing {}
133
-
134
- export class AirMonitor extends Thing {
135
- static with<
136
- T1 extends { prototype: unknown },
137
- constructorArgs extends unknown[],
138
- >(t1: T1): new (...args: constructorArgs) => AirMonitor & Proto<T1>;
139
-
140
- static with<
141
- T1 extends { prototype: unknown },
142
- T2 extends { prototype: unknown },
143
- constructorArgs extends unknown[],
144
- >(
145
- t1: T1,
146
- t2: T2,
147
- ): new (...args: constructorArgs) => AirMonitor & Proto<T1> & Proto<T2>;
148
-
149
- static with<
150
- T1 extends { prototype: unknown },
151
- T2 extends { prototype: unknown },
152
- T3 extends { prototype: unknown },
153
- constructorArgs extends unknown[],
154
- >(
155
- t1: T1,
156
- t2: T2,
157
- t3: T3,
158
- ): new (
159
- ...args: constructorArgs
160
- ) => AirMonitor & Proto<T1> & Proto<T2> & Proto<T3>;
161
-
162
- static with<
163
- T1 extends { prototype: unknown },
164
- T2 extends { prototype: unknown },
165
- T3 extends { prototype: unknown },
166
- T4 extends { prototype: unknown },
167
- constructorArgs extends unknown[],
168
- >(
169
- t1: T1,
170
- t2: T2,
171
- t3: T3,
172
- t4: T4,
173
- ): new (
174
- ...args: constructorArgs
175
- ) => AirMonitor & Proto<T1> & Proto<T2> & Proto<T3> & Proto<T4>;
176
-
177
- static with<
178
- T1 extends { prototype: unknown },
179
- T2 extends { prototype: unknown },
180
- T3 extends { prototype: unknown },
181
- T4 extends { prototype: unknown },
182
- T5 extends { prototype: unknown },
183
- constructorArgs extends unknown[],
184
- >(
185
- t1: T1,
186
- t2: T2,
187
- t3: T3,
188
- t4: T4,
189
- t5: T5,
190
- ): new (
191
- ...args: constructorArgs
192
- ) => AirMonitor & Proto<T1> & Proto<T2> & Proto<T3> & Proto<T4> & Proto<T5>;
193
-
194
- static with<
195
- T1 extends { prototype: unknown },
196
- T2 extends { prototype: unknown },
197
- T3 extends { prototype: unknown },
198
- T4 extends { prototype: unknown },
199
- T5 extends { prototype: unknown },
200
- T6 extends { prototype: unknown },
201
- constructorArgs extends unknown[],
202
- >(
203
- t1: T1,
204
- t2: T2,
205
- t3: T3,
206
- t4: T4,
207
- t5: T5,
208
- t6: T6,
209
- ): new (
210
- ...args: constructorArgs
211
- ) => AirMonitor &
212
- Proto<T1> &
213
- Proto<T2> &
214
- Proto<T3> &
215
- Proto<T4> &
216
- Proto<T5> &
217
- Proto<T6>;
218
-
219
- static with<
220
- T1 extends { prototype: unknown },
221
- T2 extends { prototype: unknown },
222
- T3 extends { prototype: unknown },
223
- T4 extends { prototype: unknown },
224
- T5 extends { prototype: unknown },
225
- T6 extends { prototype: unknown },
226
- T7 extends { prototype: unknown },
227
- constructorArgs extends unknown[],
228
- >(
229
- t1: T1,
230
- t2: T2,
231
- t3: T3,
232
- t4: T4,
233
- t5: T5,
234
- t6: T6,
235
- t7: T7,
236
- ): new (
237
- ...args: constructorArgs
238
- ) => AirMonitor &
239
- Proto<T1> &
240
- Proto<T2> &
241
- Proto<T3> &
242
- Proto<T4> &
243
- Proto<T5> &
244
- Proto<T6> &
245
- Proto<T7>;
246
- }
247
-
248
- export class AirPurifier extends Thing {
249
- static with<
250
- T1 extends { prototype: unknown },
251
- constructorArgs extends unknown[],
252
- >(t1: T1): new (...args: constructorArgs) => AirMonitor & Proto<T1>;
253
-
254
- static with<
255
- T1 extends { prototype: unknown },
256
- T2 extends { prototype: unknown },
257
- constructorArgs extends unknown[],
258
- >(
259
- t1: T1,
260
- t2: T2,
261
- ): new (...args: constructorArgs) => AirPurifier & Proto<T1> & Proto<T2>;
262
-
263
- static with<
264
- T1 extends { prototype: unknown },
265
- T2 extends { prototype: unknown },
266
- T3 extends { prototype: unknown },
267
- constructorArgs extends unknown[],
268
- >(
269
- t1: T1,
270
- t2: T2,
271
- t3: T3,
272
- ): new (
273
- ...args: constructorArgs
274
- ) => AirPurifier & Proto<T1> & Proto<T2> & Proto<T3>;
275
-
276
- static with<
277
- T1 extends { prototype: unknown },
278
- T2 extends { prototype: unknown },
279
- T3 extends { prototype: unknown },
280
- T4 extends { prototype: unknown },
281
- constructorArgs extends unknown[],
282
- >(
283
- t1: T1,
284
- t2: T2,
285
- t3: T3,
286
- t4: T4,
287
- ): new (
288
- ...args: constructorArgs
289
- ) => AirPurifier & Proto<T1> & Proto<T2> & Proto<T3> & Proto<T4>;
290
-
291
- static with<
292
- T1 extends { prototype: unknown },
293
- T2 extends { prototype: unknown },
294
- T3 extends { prototype: unknown },
295
- T4 extends { prototype: unknown },
296
- T5 extends { prototype: unknown },
297
- constructorArgs extends unknown[],
298
- >(
299
- t1: T1,
300
- t2: T2,
301
- t3: T3,
302
- t4: T4,
303
- t5: T5,
304
- ): new (
305
- ...args: constructorArgs
306
- ) => AirPurifier &
307
- Proto<T1> &
308
- Proto<T2> &
309
- Proto<T3> &
310
- Proto<T4> &
311
- Proto<T5>;
312
-
313
- static with<
314
- T1 extends { prototype: unknown },
315
- T2 extends { prototype: unknown },
316
- T3 extends { prototype: unknown },
317
- T4 extends { prototype: unknown },
318
- T5 extends { prototype: unknown },
319
- T6 extends { prototype: unknown },
320
- constructorArgs extends unknown[],
321
- >(
322
- t1: T1,
323
- t2: T2,
324
- t3: T3,
325
- t4: T4,
326
- t5: T5,
327
- t6: T6,
328
- ): new (
329
- ...args: constructorArgs
330
- ) => AirPurifier &
331
- Proto<T1> &
332
- Proto<T2> &
333
- Proto<T3> &
334
- Proto<T4> &
335
- Proto<T5> &
336
- Proto<T6>;
337
-
338
- static with<
339
- T1 extends { prototype: unknown },
340
- T2 extends { prototype: unknown },
341
- T3 extends { prototype: unknown },
342
- T4 extends { prototype: unknown },
343
- T5 extends { prototype: unknown },
344
- T6 extends { prototype: unknown },
345
- T7 extends { prototype: unknown },
346
- constructorArgs extends unknown[],
347
- >(
348
- t1: T1,
349
- t2: T2,
350
- t3: T3,
351
- t4: T4,
352
- t5: T5,
353
- t6: T6,
354
- t7: T7,
355
- ): new (
356
- ...args: constructorArgs
357
- ) => AirPurifier &
358
- Proto<T1> &
359
- Proto<T2> &
360
- Proto<T3> &
361
- Proto<T4> &
362
- Proto<T5> &
363
- Proto<T6> &
364
- Proto<T7>;
365
-
366
- static with<
367
- T1 extends { prototype: unknown },
368
- T2 extends { prototype: unknown },
369
- T3 extends { prototype: unknown },
370
- T4 extends { prototype: unknown },
371
- T5 extends { prototype: unknown },
372
- T6 extends { prototype: unknown },
373
- T7 extends { prototype: unknown },
374
- T8 extends { prototype: unknown },
375
- constructorArgs extends unknown[],
376
- >(
377
- t1: T1,
378
- t2: T2,
379
- t3: T3,
380
- t4: T4,
381
- t5: T5,
382
- t6: T6,
383
- t7: T7,
384
- t8: T8,
385
- ): new (
386
- ...args: constructorArgs
387
- ) => AirPurifier &
388
- Proto<T1> &
389
- Proto<T2> &
390
- Proto<T3> &
391
- Proto<T4> &
392
- Proto<T5> &
393
- Proto<T6> &
394
- Proto<T7> &
395
- Proto<T8>;
396
-
397
- static with<
398
- T1 extends { prototype: unknown },
399
- T2 extends { prototype: unknown },
400
- T3 extends { prototype: unknown },
401
- T4 extends { prototype: unknown },
402
- T5 extends { prototype: unknown },
403
- T6 extends { prototype: unknown },
404
- T7 extends { prototype: unknown },
405
- T8 extends { prototype: unknown },
406
- T9 extends { prototype: unknown },
407
- constructorArgs extends unknown[],
408
- >(
409
- t1: T1,
410
- t2: T2,
411
- t3: T3,
412
- t4: T4,
413
- t5: T5,
414
- t6: T6,
415
- t7: T7,
416
- t8: T8,
417
- t9: T9,
418
- ): new (
419
- ...args: constructorArgs
420
- ) => AirPurifier &
421
- Proto<T1> &
422
- Proto<T2> &
423
- Proto<T3> &
424
- Proto<T4> &
425
- Proto<T5> &
426
- Proto<T6> &
427
- Proto<T7> &
428
- Proto<T8> &
429
- Proto<T9>;
430
- }
431
- }
@@ -1,5 +0,0 @@
1
- declare module "abstract-things/electrical" {
2
- import { Thing } from "abstract-things";
3
- export class PowerPlug extends Thing {}
4
- export class PowerOutlet extends Thing {}
5
- }