node-miio 0.3.0 → 0.5.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 (174) hide show
  1. package/.claude/settings.json +5 -0
  2. package/.claude/skills/release/SKILL.md +73 -0
  3. package/AGENTS.md +25 -2
  4. package/CONTRIBUTING.md +41 -87
  5. package/LICENSE.md +28 -0
  6. package/README.md +86 -44
  7. package/dist/cli/commands/cloud/devices.d.ts +10 -0
  8. package/dist/cli/commands/cloud/devices.js +71 -0
  9. package/dist/cli/commands/cloud/devices.js.map +1 -0
  10. package/dist/cli/commands/cloud/login.d.ts +8 -0
  11. package/dist/cli/commands/cloud/login.js +63 -0
  12. package/dist/cli/commands/cloud/login.js.map +1 -0
  13. package/dist/cli/commands/cloud/logout.d.ts +4 -0
  14. package/dist/cli/commands/cloud/logout.js +14 -0
  15. package/dist/cli/commands/cloud/logout.js.map +1 -0
  16. package/dist/cli/commands/cloud.d.ts +5 -0
  17. package/dist/cli/commands/cloud.js +49 -0
  18. package/dist/cli/commands/cloud.js.map +1 -0
  19. package/dist/cli/commands/configure.d.ts +18 -0
  20. package/dist/cli/commands/control.d.ts +4 -0
  21. package/dist/cli/commands/discover.d.ts +9 -0
  22. package/dist/cli/commands/inspect.d.ts +4 -0
  23. package/dist/cli/commands/miot-spec.d.ts +10 -0
  24. package/dist/cli/commands/protocol/call.d.ts +9 -0
  25. package/dist/cli/commands/protocol/json-dump.d.ts +8 -0
  26. package/dist/cli/commands/protocol/packet.d.ts +8 -0
  27. package/dist/cli/commands/protocol.d.ts +5 -0
  28. package/dist/cli/commands/tokens/update.d.ts +9 -0
  29. package/dist/cli/commands/tokens.d.ts +5 -0
  30. package/dist/cli/device-finder.d.ts +3 -0
  31. package/dist/cli/index.d.ts +2 -0
  32. package/dist/cli/index.js +2 -0
  33. package/dist/cli/index.js.map +1 -1
  34. package/dist/cli/log.d.ts +9 -0
  35. package/dist/cli/prompt.d.ts +11 -0
  36. package/dist/cli/prompt.js +42 -0
  37. package/dist/cli/prompt.js.map +1 -0
  38. package/dist/cli/terminal_qr.d.ts +7 -0
  39. package/dist/cli/terminal_qr.js +14 -0
  40. package/dist/cli/terminal_qr.js.map +1 -0
  41. package/dist/lib/check_result.d.ts +6 -0
  42. package/dist/lib/cloud/client.d.ts +142 -0
  43. package/dist/lib/cloud/client.js +282 -0
  44. package/dist/lib/cloud/client.js.map +1 -0
  45. package/dist/lib/cloud/crypto.d.ts +56 -0
  46. package/dist/lib/cloud/crypto.js +128 -0
  47. package/dist/lib/cloud/crypto.js.map +1 -0
  48. package/dist/lib/cloud/errors.d.ts +26 -0
  49. package/dist/lib/cloud/errors.js +50 -0
  50. package/dist/lib/cloud/errors.js.map +1 -0
  51. package/dist/lib/cloud/http.d.ts +55 -0
  52. package/dist/lib/cloud/http.js +159 -0
  53. package/dist/lib/cloud/http.js.map +1 -0
  54. package/dist/lib/cloud/index.d.ts +5 -0
  55. package/dist/lib/cloud/index.js +22 -0
  56. package/dist/lib/cloud/index.js.map +1 -0
  57. package/dist/lib/cloud/login.d.ts +57 -0
  58. package/dist/lib/cloud/login.js +352 -0
  59. package/dist/lib/cloud/login.js.map +1 -0
  60. package/dist/lib/cloud/session_store.d.ts +27 -0
  61. package/dist/lib/cloud/session_store.js +71 -0
  62. package/dist/lib/cloud/session_store.js.map +1 -0
  63. package/dist/lib/connect_to_device.d.ts +10 -0
  64. package/dist/lib/device.d.ts +151 -0
  65. package/dist/lib/device.js +53 -19
  66. package/dist/lib/device.js.map +1 -1
  67. package/dist/lib/device_info.d.ts +66 -0
  68. package/dist/lib/device_info.js +23 -10
  69. package/dist/lib/device_info.js.map +1 -1
  70. package/dist/lib/devices/air-monitor.d.ts +8 -0
  71. package/dist/lib/devices/air-purifier.d.ts +40 -0
  72. package/dist/lib/devices/capabilities/battery-level.d.ts +22 -0
  73. package/dist/lib/devices/capabilities/buzzer.d.ts +33 -0
  74. package/dist/lib/devices/capabilities/changeable-led-brightness.d.ts +35 -0
  75. package/dist/lib/devices/capabilities/colorable.d.ts +21 -0
  76. package/dist/lib/devices/capabilities/dimmable.d.ts +21 -0
  77. package/dist/lib/devices/capabilities/mode.d.ts +21 -0
  78. package/dist/lib/devices/capabilities/power.d.ts +21 -0
  79. package/dist/lib/devices/capabilities/sensor.d.ts +15 -0
  80. package/dist/lib/devices/capabilities/switchable-led.d.ts +35 -0
  81. package/dist/lib/devices/chuangmi.plug.v1.d.ts +31 -0
  82. package/dist/lib/devices/eyecare-lamp2.d.ts +91 -0
  83. package/dist/lib/devices/gateway/86sw1.d.ts +7 -0
  84. package/dist/lib/devices/gateway/86sw2.d.ts +7 -0
  85. package/dist/lib/devices/gateway/ctrl_ln1.d.ts +8 -0
  86. package/dist/lib/devices/gateway/ctrl_ln2.d.ts +8 -0
  87. package/dist/lib/devices/gateway/ctrl_neutral1.d.ts +8 -0
  88. package/dist/lib/devices/gateway/ctrl_neutral2.d.ts +8 -0
  89. package/dist/lib/devices/gateway/cube.d.ts +6 -0
  90. package/dist/lib/devices/gateway/developer-api.d.ts +15 -0
  91. package/dist/lib/devices/gateway/light-channel.d.ts +10 -0
  92. package/dist/lib/devices/gateway/light-mixin.d.ts +2 -0
  93. package/dist/lib/devices/gateway/magnet.d.ts +6 -0
  94. package/dist/lib/devices/gateway/magnet2.d.ts +5 -0
  95. package/dist/lib/devices/gateway/motion.d.ts +6 -0
  96. package/dist/lib/devices/gateway/motion2.d.ts +6 -0
  97. package/dist/lib/devices/gateway/plug.d.ts +6 -0
  98. package/dist/lib/devices/gateway/sensor_ht.d.ts +5 -0
  99. package/dist/lib/devices/gateway/subdevice.d.ts +70 -0
  100. package/dist/lib/devices/gateway/subdevices.d.ts +49 -0
  101. package/dist/lib/devices/gateway/switch.d.ts +6 -0
  102. package/dist/lib/devices/gateway/switch2.d.ts +6 -0
  103. package/dist/lib/devices/gateway/voltage.d.ts +23 -0
  104. package/dist/lib/devices/gateway/weather.d.ts +5 -0
  105. package/dist/lib/devices/gateway.d.ts +98 -0
  106. package/dist/lib/devices/humidifier.d.ts +20 -0
  107. package/dist/lib/devices/philips-light-bulb.d.ts +8 -0
  108. package/dist/lib/devices/power-plug.d.ts +30 -0
  109. package/dist/lib/devices/power-strip.d.ts +7 -0
  110. package/dist/lib/devices/vacuums/dreamevacuum.d.ts +81 -0
  111. package/dist/lib/devices/vacuums/dreamevacuum.js +10 -2
  112. package/dist/lib/devices/vacuums/dreamevacuum.js.map +1 -1
  113. package/dist/lib/devices/vacuums/mijiavacuum.d.ts +4 -0
  114. package/dist/lib/devices/vacuums/miot-vacuum.d.ts +130 -0
  115. package/dist/lib/devices/vacuums/miot-vacuum.js +2 -0
  116. package/dist/lib/devices/vacuums/miot-vacuum.js.map +1 -1
  117. package/dist/lib/devices/vacuums/vacuum.d.ts +276 -0
  118. package/dist/lib/devices/vacuums/vacuum.js +82 -0
  119. package/dist/lib/devices/vacuums/vacuum.js.map +1 -1
  120. package/dist/lib/devices/vacuums/vacuum_device.d.ts +17 -0
  121. package/dist/lib/devices/vacuums/vacuum_device.js +14 -0
  122. package/dist/lib/devices/vacuums/vacuum_device.js.map +1 -0
  123. package/dist/lib/devices/vacuums/vacuum_errors.d.ts +10 -0
  124. package/dist/lib/devices/vacuums/vacuum_errors.js +25 -0
  125. package/dist/lib/devices/vacuums/vacuum_errors.js.map +1 -0
  126. package/dist/lib/devices/vacuums/vacuum_modes.d.ts +51 -0
  127. package/dist/lib/devices/vacuums/viomivacuum.d.ts +76 -0
  128. package/dist/lib/devices/vacuums/viomivacuum.js +2 -0
  129. package/dist/lib/devices/vacuums/viomivacuum.js.map +1 -1
  130. package/dist/lib/devices/yeelight.color.d.ts +3 -0
  131. package/dist/lib/devices/yeelight.d.ts +159 -0
  132. package/dist/lib/devices/yeelight.mono.d.ts +3 -0
  133. package/dist/lib/discovery.d.ts +53 -0
  134. package/dist/lib/events.d.ts +18 -0
  135. package/dist/lib/events.js +3 -0
  136. package/dist/lib/events.js.map +1 -0
  137. package/dist/lib/index.d.ts +60 -0
  138. package/dist/lib/index.js +18 -1
  139. package/dist/lib/index.js.map +1 -1
  140. package/dist/lib/info_from_hostname.d.ts +13 -0
  141. package/dist/lib/logger.d.ts +43 -0
  142. package/dist/lib/logger.js +62 -0
  143. package/dist/lib/logger.js.map +1 -0
  144. package/dist/lib/management.d.ts +53 -0
  145. package/dist/lib/maps/map_watcher.d.ts +71 -0
  146. package/dist/lib/maps/map_watcher.js +127 -0
  147. package/dist/lib/maps/map_watcher.js.map +1 -0
  148. package/dist/lib/maps/roborock_map.d.ts +83 -0
  149. package/dist/lib/maps/roborock_map.js +269 -0
  150. package/dist/lib/maps/roborock_map.js.map +1 -0
  151. package/dist/lib/miio_error.d.ts +12 -0
  152. package/dist/lib/miot/miot_api.d.ts +54 -0
  153. package/dist/lib/miot/miot_spec.d.ts +114 -0
  154. package/dist/lib/miot/spec_client.d.ts +125 -0
  155. package/dist/lib/miot/spec_client.js +2 -2
  156. package/dist/lib/miot/spec_client.js.map +1 -1
  157. package/dist/lib/models.d.ts +271 -0
  158. package/dist/lib/network.d.ts +58 -0
  159. package/dist/lib/network.js +5 -2
  160. package/dist/lib/network.js.map +1 -1
  161. package/dist/lib/packet.d.ts +21 -0
  162. package/dist/lib/placeholder.d.ts +7 -0
  163. package/dist/lib/protocol.d.ts +299 -0
  164. package/dist/lib/safeish_json.d.ts +7 -0
  165. package/dist/lib/tokens.d.ts +12 -0
  166. package/dist/types/abstract-things/climate/index.d.ts +431 -0
  167. package/dist/types/abstract-things/electricals/index.d.ts +5 -0
  168. package/dist/types/abstract-things/index.d.ts +206 -0
  169. package/dist/types/abstract-things/lights/index.d.ts +14 -0
  170. package/dist/types/abstract-things/values/index.d.ts +12 -0
  171. package/docs/cloud.md +74 -0
  172. package/docs/devices/vacuum.md +9 -1
  173. package/package.json +7 -3
  174. package/snapshots/vacuum-specs.json.gz +0 -0
@@ -0,0 +1,33 @@
1
+ import { Thing } from "abstract-things";
2
+ export declare const Buzzer: new (...args: unknown[]) => {
3
+ propertyUpdated(key: any, value: any): void;
4
+ /**
5
+ * Get or set if the buzzer is active.
6
+ *
7
+ * @param active
8
+ * Optional boolean to switch buzzer to.
9
+ */
10
+ buzzer(active: any): any;
11
+ getBuzzer(): unknown;
12
+ setBuzzer(active: any): any;
13
+ changeBuzzer(active: any): any;
14
+ id: string | null;
15
+ metadata: Record<string, unknown> & {
16
+ types: string[];
17
+ capabilities: string[];
18
+ addCapabilities(...capabilities: string[]): void;
19
+ };
20
+ init(): Promise</*elided*/ any | undefined>;
21
+ initCallback(): Promise<void>;
22
+ destroy(): Promise<void>;
23
+ destroyCallback(): Promise<void>;
24
+ debug(...parts: unknown[]): void;
25
+ matches(...tags: string[]): boolean;
26
+ emitEvent(event: string, data?: unknown, options?: unknown): void;
27
+ on(event: string, listener: (...args: never[]) => void): unknown;
28
+ off(event: string, listener: (...args: never[]) => void): unknown;
29
+ extendWith<T>(...mixins: T[]): T & Thing;
30
+ state(): Promise<Record<string, unknown>>;
31
+ getState<T>(name: string): T;
32
+ updateState<T>(name: string, value: T): boolean;
33
+ } & Thing;
@@ -0,0 +1,35 @@
1
+ import { Thing } from "abstract-things";
2
+ export declare const LEDBrightness: new (...args: unknown[]) => {
3
+ propertyUpdated(key: any, value: any): void;
4
+ /**
5
+ * Get or set if the LED brightness.
6
+ *
7
+ * @param brightness The LED brightness
8
+ */
9
+ ledBrightness(brightness?: string | unknown): Promise<unknown>;
10
+ /**
11
+ * Set the LED brightness.
12
+ *
13
+ * @param _brightness
14
+ */
15
+ changeLEDBrightness(_brightness: string): Promise<void>;
16
+ id: string | null;
17
+ metadata: Record<string, unknown> & {
18
+ types: string[];
19
+ capabilities: string[];
20
+ addCapabilities(...capabilities: string[]): void;
21
+ };
22
+ init(): Promise</*elided*/ any | undefined>;
23
+ initCallback(): Promise<void>;
24
+ destroy(): Promise<void>;
25
+ destroyCallback(): Promise<void>;
26
+ debug(...parts: unknown[]): void;
27
+ matches(...tags: string[]): boolean;
28
+ emitEvent(event: string, data?: unknown, options?: unknown): void;
29
+ on(event: string, listener: (...args: never[]) => void): unknown;
30
+ off(event: string, listener: (...args: never[]) => void): unknown;
31
+ extendWith<T>(...mixins: T[]): T & Thing;
32
+ state(): Promise<Record<string, unknown>>;
33
+ getState<T>(name: string): T;
34
+ updateState<T>(name: string, value: T): boolean;
35
+ } & Thing;
@@ -0,0 +1,21 @@
1
+ import { Thing } from "abstract-things";
2
+ export declare const Colorable: new (...args: unknown[]) => {
3
+ propertyUpdated(key: any, value: any): void;
4
+ id: string | null;
5
+ metadata: Record<string, unknown> & {
6
+ types: string[];
7
+ capabilities: string[];
8
+ addCapabilities(...capabilities: string[]): void;
9
+ };
10
+ init(): Promise</*elided*/ any | undefined>;
11
+ initCallback(): Promise<void>;
12
+ destroy(): Promise<void>;
13
+ destroyCallback(): Promise<void>;
14
+ debug(...parts: unknown[]): void;
15
+ matches(...tags: string[]): boolean;
16
+ emitEvent(event: string, data?: unknown, options?: unknown): void;
17
+ on(event: string, listener: (...args: never[]) => void): unknown;
18
+ off(event: string, listener: (...args: never[]) => void): unknown;
19
+ extendWith<T>(...mixins: T[]): T & Thing;
20
+ updateColor(value: import("abstract-things/values").Color): void;
21
+ } & Thing;
@@ -0,0 +1,21 @@
1
+ import { Thing } from "abstract-things";
2
+ export declare const Dimmable: new (...args: unknown[]) => {
3
+ propertyUpdated(key: any, value: any): void;
4
+ id: string | null;
5
+ metadata: Record<string, unknown> & {
6
+ types: string[];
7
+ capabilities: string[];
8
+ addCapabilities(...capabilities: string[]): void;
9
+ };
10
+ init(): Promise</*elided*/ any | undefined>;
11
+ initCallback(): Promise<void>;
12
+ destroy(): Promise<void>;
13
+ destroyCallback(): Promise<void>;
14
+ debug(...parts: unknown[]): void;
15
+ matches(...tags: string[]): boolean;
16
+ emitEvent(event: string, data?: unknown, options?: unknown): void;
17
+ on(event: string, listener: (...args: never[]) => void): unknown;
18
+ off(event: string, listener: (...args: never[]) => void): unknown;
19
+ extendWith<T>(...mixins: T[]): T & Thing;
20
+ updateBrightness(value: number): void;
21
+ } & Thing;
@@ -0,0 +1,21 @@
1
+ import { Thing } from "abstract-things";
2
+ export declare const Mode: new (...args: unknown[]) => {
3
+ propertyUpdated(key: any, value: any): void;
4
+ id: string | null;
5
+ metadata: Record<string, unknown> & {
6
+ types: string[];
7
+ capabilities: string[];
8
+ addCapabilities(...capabilities: string[]): void;
9
+ };
10
+ init(): Promise</*elided*/ any | undefined>;
11
+ initCallback(): Promise<void>;
12
+ destroy(): Promise<void>;
13
+ destroyCallback(): Promise<void>;
14
+ debug(...parts: unknown[]): void;
15
+ matches(...tags: string[]): boolean;
16
+ emitEvent(event: string, data?: unknown, options?: unknown): void;
17
+ on(event: string, listener: (...args: never[]) => void): unknown;
18
+ off(event: string, listener: (...args: never[]) => void): unknown;
19
+ extendWith<T>(...mixins: T[]): T & Thing;
20
+ updateMode<T>(value: T): void;
21
+ } & Thing;
@@ -0,0 +1,21 @@
1
+ import { Thing } from "abstract-things";
2
+ export declare const Power: new (...args: unknown[]) => {
3
+ propertyUpdated<T>(key: string, value: T): void;
4
+ id: string | null;
5
+ metadata: Record<string, unknown> & {
6
+ types: string[];
7
+ capabilities: string[];
8
+ addCapabilities(...capabilities: string[]): void;
9
+ };
10
+ init(): Promise</*elided*/ any | undefined>;
11
+ initCallback(): Promise<void>;
12
+ destroy(): Promise<void>;
13
+ destroyCallback(): Promise<void>;
14
+ debug(...parts: unknown[]): void;
15
+ matches(...tags: string[]): boolean;
16
+ emitEvent(event: string, data?: unknown, options?: unknown): void;
17
+ on(event: string, listener: (...args: never[]) => void): unknown;
18
+ off(event: string, listener: (...args: never[]) => void): unknown;
19
+ extendWith<T>(...mixins: T[]): T & Thing;
20
+ updatePower<T>(value: T): void;
21
+ } & Thing;
@@ -0,0 +1,15 @@
1
+ export const Temperature: new (...args: unknown[]) => any;
2
+ export const Humidity: new (...args: unknown[]) => any;
3
+ export const Illuminance: new (...args: unknown[]) => any;
4
+ export const AQI: new (...args: unknown[]) => any;
5
+ export const AtmosphericPressure: new (...args: unknown[]) => any;
6
+ export const PowerLoad: new (...args: unknown[]) => any;
7
+ export const PowerConsumed: new (...args: unknown[]) => any;
8
+ export { mixin as extend };
9
+ /**
10
+ * Setup sensor support for a device.
11
+ *
12
+ * @param {object} device The device
13
+ * @param {object} options The sensor options
14
+ */
15
+ declare function mixin(device: object, options: object): void;
@@ -0,0 +1,35 @@
1
+ import { Thing } from "abstract-things";
2
+ export declare const SwitchableLED: new (...args: unknown[]) => {
3
+ propertyUpdated(key: any, value: any): void;
4
+ /**
5
+ * Get or set if the LED should be on.
6
+ *
7
+ * @param power Optional power to set LED to
8
+ */
9
+ led(power: any): any;
10
+ /**
11
+ * Set if the LED should be on when the device is running.
12
+ *
13
+ * @param power
14
+ */
15
+ changeLED(power: any): any;
16
+ id: string | null;
17
+ metadata: Record<string, unknown> & {
18
+ types: string[];
19
+ capabilities: string[];
20
+ addCapabilities(...capabilities: string[]): void;
21
+ };
22
+ init(): Promise</*elided*/ any | undefined>;
23
+ initCallback(): Promise<void>;
24
+ destroy(): Promise<void>;
25
+ destroyCallback(): Promise<void>;
26
+ debug(...parts: unknown[]): void;
27
+ matches(...tags: string[]): boolean;
28
+ emitEvent(event: string, data?: unknown, options?: unknown): void;
29
+ on(event: string, listener: (...args: never[]) => void): unknown;
30
+ off(event: string, listener: (...args: never[]) => void): unknown;
31
+ extendWith<T>(...mixins: T[]): T & Thing;
32
+ state(): Promise<Record<string, unknown>>;
33
+ getState<T>(name: string): T;
34
+ updateState<T>(name: string, value: T): boolean;
35
+ } & Thing;
@@ -0,0 +1,31 @@
1
+ export = exports;
2
+ declare const exports_base: new (...args: unknown[]) => Thing & PowerPlug & PowerOutlet & MiioApi & {
3
+ propertyUpdated<T>(key: string, value: T): void;
4
+ id: string | null;
5
+ metadata: Record<string, unknown> & {
6
+ types: string[];
7
+ capabilities: string[];
8
+ addCapabilities(...capabilities: string[]): void;
9
+ };
10
+ init(): Promise</*elided*/ any | undefined>;
11
+ initCallback(): Promise<void>;
12
+ destroy(): Promise<void>;
13
+ destroyCallback(): Promise<void>;
14
+ debug(...parts: unknown[]): void;
15
+ matches(...tags: string[]): boolean;
16
+ emitEvent(event: string, data?: unknown, options?: unknown): void;
17
+ on(event: string, listener: (...args: never[]) => void): unknown;
18
+ off(event: string, listener: (...args: never[]) => void): unknown;
19
+ extendWith<T>(...mixins: T[]): T & Thing;
20
+ updatePower<T>(value: T): void;
21
+ };
22
+ declare class exports extends exports_base {
23
+ static get type(): string;
24
+ constructor(options: any);
25
+ setName(name: any): any;
26
+ propertyUpdated(key: any, value: any): void;
27
+ }
28
+ import { Thing } from "abstract-things";
29
+ import { PowerPlug } from "abstract-things/electrical";
30
+ import { PowerOutlet } from "abstract-things/electrical";
31
+ import { MiioApi } from "../device";
@@ -0,0 +1,91 @@
1
+ export = EyecareLamp2;
2
+ declare const EyecareLamp2_base: new (...args: unknown[]) => import("abstract-things").Thing & {
3
+ propertyUpdated<T>(key: string, value: T): void;
4
+ id: string | null;
5
+ metadata: Record<string, unknown> & {
6
+ types: string[];
7
+ capabilities: string[];
8
+ addCapabilities(...capabilities: string[]): void;
9
+ };
10
+ init(): Promise</*elided*/ any | undefined>;
11
+ initCallback(): Promise<void>;
12
+ destroy(): Promise<void>;
13
+ destroyCallback(): Promise<void>;
14
+ debug(...parts: unknown[]): void;
15
+ matches(...tags: string[]): boolean;
16
+ emitEvent(event: string, data?: unknown, options?: unknown): void;
17
+ on(event: string, listener: (...args: never[]) => void): unknown;
18
+ off(event: string, listener: (...args: never[]) => void): unknown;
19
+ extendWith<T>(...mixins: T[]): T & import("abstract-things").Thing;
20
+ updatePower<T>(value: T): void;
21
+ } & {
22
+ propertyUpdated(key: any, value: any): void;
23
+ id: string | null;
24
+ metadata: Record<string, unknown> & {
25
+ types: string[];
26
+ capabilities: string[];
27
+ addCapabilities(...capabilities: string[]): void;
28
+ };
29
+ init(): Promise</*elided*/ any | undefined>;
30
+ initCallback(): Promise<void>;
31
+ destroy(): Promise<void>;
32
+ destroyCallback(): Promise<void>;
33
+ debug(...parts: unknown[]): void;
34
+ matches(...tags: string[]): boolean;
35
+ emitEvent(event: string, data?: unknown, options?: unknown): void;
36
+ on(event: string, listener: (...args: never[]) => void): unknown;
37
+ off(event: string, listener: (...args: never[]) => void): unknown;
38
+ extendWith<T>(...mixins: T[]): T & import("abstract-things").Thing;
39
+ updateBrightness(value: number): void;
40
+ } & Children & MiioApi;
41
+ declare class EyecareLamp2 extends EyecareLamp2_base {
42
+ constructor(options: any);
43
+ ambient: AmbientLight;
44
+ changePower(power: any): Promise<unknown>;
45
+ changeBrightness(brightness: any): Promise<null>;
46
+ /**
47
+ * Is eyeCare active?
48
+ */
49
+ eyeCare(): Promise<any>;
50
+ /**
51
+ * Enable the eyeCare
52
+ *
53
+ * @param {boolean} enable Whether to enable it
54
+ */
55
+ setEyeCare(enable: boolean): Promise<null>;
56
+ /**
57
+ * Set the current eyeCare mode
58
+ *
59
+ changeMode(mode) {
60
+
61
+ switch (mode) {
62
+ case 'study':
63
+ mode = 1;
64
+ break;
65
+ case 'reading':
66
+ mode = 2;
67
+ break;
68
+ case 'phone':
69
+ mode = 3;
70
+ break;
71
+ default:
72
+ return Promise.reject(new Error('Invalid EyeCare Mode: ' + mode));
73
+ }
74
+ return this.call('set_user_scene', [mode], {
75
+ refresh: true
76
+ });
77
+ }
78
+ */
79
+ setAmbientPower(power: any): any;
80
+ setAmbientBrightness(brightness: any): any;
81
+ propertyUpdated(key: any, value: any): void;
82
+ }
83
+ import { Children } from "abstract-things";
84
+ import { MiioApi } from "../device";
85
+ declare class AmbientLight {
86
+ constructor(parent: any);
87
+ parent: any;
88
+ id: string;
89
+ changePower(power: any): any;
90
+ changeBrightness(brightness: any): any;
91
+ }
@@ -0,0 +1,7 @@
1
+ export = Switch1;
2
+ declare class Switch1 {
3
+ constructor(parent: any, info: any);
4
+ type: string;
5
+ miioModel: string;
6
+ _report(data: any): void;
7
+ }
@@ -0,0 +1,7 @@
1
+ export = Switch2;
2
+ declare class Switch2 {
3
+ constructor(parent: any, info: any);
4
+ type: string;
5
+ miioModel: string;
6
+ _report(data: any): void;
7
+ }
@@ -0,0 +1,8 @@
1
+ export = CtrlLN1;
2
+ declare class CtrlLN1 {
3
+ static get type(): string;
4
+ constructor(parent: any, info: any);
5
+ miioModel: string;
6
+ changePowerChannel(channel: any, power: any): any;
7
+ propertyUpdated(key: any, value: any): void;
8
+ }
@@ -0,0 +1,8 @@
1
+ export = CtrlLN2;
2
+ declare class CtrlLN2 {
3
+ static get type(): string;
4
+ constructor(parent: any, info: any);
5
+ miioModel: string;
6
+ changePowerChannel(channel: any, power: any): any;
7
+ propertyUpdated(key: any, value: any): void;
8
+ }
@@ -0,0 +1,8 @@
1
+ export = CtrlNeutral1;
2
+ declare class CtrlNeutral1 {
3
+ static get type(): string;
4
+ constructor(parent: any, info: any);
5
+ miioModel: string;
6
+ changePowerChannel(channel: any, power: any): any;
7
+ propertyUpdated(key: any, value: any): void;
8
+ }
@@ -0,0 +1,8 @@
1
+ export = CtrlNeutral2;
2
+ declare class CtrlNeutral2 {
3
+ static get type(): string;
4
+ constructor(parent: any, info: any);
5
+ miioModel: string;
6
+ changePowerChannel(channel: any, power: any): any;
7
+ propertyUpdated(key: any, value: any): void;
8
+ }
@@ -0,0 +1,6 @@
1
+ export = Cube;
2
+ declare class Cube {
3
+ constructor(parent: any, info: any);
4
+ miioModel: string;
5
+ _report(data: any): void;
6
+ }
@@ -0,0 +1,15 @@
1
+ export = DeveloperApi;
2
+ declare class DeveloperApi extends EventEmitter<[never]> {
3
+ constructor(parent: any, address: any);
4
+ address: any;
5
+ port: number;
6
+ debug: (...args: any[]) => void;
7
+ socket: dgram.Socket;
8
+ destroy(): void;
9
+ send(data: any): void;
10
+ read(sid: any): void;
11
+ _onMessage(msg: any): void;
12
+ sid: any;
13
+ }
14
+ import EventEmitter = require("events");
15
+ import dgram = require("node:dgram");
@@ -0,0 +1,10 @@
1
+ export = LightChannel;
2
+ declare class LightChannel {
3
+ static get types(): string[];
4
+ constructor(parent: any, channel: any);
5
+ id: string;
6
+ parent: any;
7
+ channel: any;
8
+ updateName(): void;
9
+ changePower(power: any): any;
10
+ }
@@ -0,0 +1,2 @@
1
+ declare const _exports: new (...args: unknown[]) => any;
2
+ export = _exports;
@@ -0,0 +1,6 @@
1
+ export = Magnet;
2
+ declare class Magnet {
3
+ constructor(parent: any, info: any);
4
+ miioModel: string;
5
+ propertyUpdated(key: any, value: any, oldValue: any): void;
6
+ }
@@ -0,0 +1,5 @@
1
+ export = Magnet2;
2
+ declare class Magnet2 extends Magnet {
3
+ constructor(...args: any[]);
4
+ }
5
+ import Magnet = require("./magnet");
@@ -0,0 +1,6 @@
1
+ export = exports;
2
+ declare class exports {
3
+ constructor(parent: any, info: any);
4
+ miioModel: string;
5
+ _report(data: any): void;
6
+ }
@@ -0,0 +1,6 @@
1
+ export = exports;
2
+ declare class exports {
3
+ constructor(parent: any, info: any);
4
+ miioModel: string;
5
+ _report(data: any): void;
6
+ }
@@ -0,0 +1,6 @@
1
+ export = Plug;
2
+ declare class Plug {
3
+ constructor(parent: any, info: any);
4
+ miioModel: string;
5
+ changePower(power: any): any;
6
+ }
@@ -0,0 +1,5 @@
1
+ export = SensorHT;
2
+ declare class SensorHT {
3
+ constructor(parent: any, info: any);
4
+ miioModel: string;
5
+ }
@@ -0,0 +1,70 @@
1
+ declare const _exports: new (parent?: any, info?: any) => {
2
+ miioModel: any;
3
+ id: any;
4
+ internalId: any;
5
+ _properties: {};
6
+ _propertiesToMonitor: any[];
7
+ _propertyDefinitions: {};
8
+ _parent: any;
9
+ _report(data: any): void;
10
+ management: SubDeviceManagement;
11
+ hasCapability(name: any): boolean;
12
+ initCallback(): Promise<any>;
13
+ destroyCallback(): Promise<any>;
14
+ _currentRead: {} | null | undefined;
15
+ get properties(): {};
16
+ property(key: any): any;
17
+ /**
18
+ * Define a property and how the value should be mapped. All defined
19
+ * properties are monitored if #monitor() is called.
20
+ *
21
+ * @param {string} name The raw property name
22
+ * @param {object} def How the value is mapped
23
+ */
24
+ defineProperty(name: string, def: object): void;
25
+ setProperty(key: any, value: any): void;
26
+ propertyUpdated(_key: any, _value: any, _oldValue: any): void;
27
+ getProperties(props?: any[]): {};
28
+ /**
29
+ * Stub for loadProperties to match full device.
30
+ *
31
+ * @param {string[]} props The properties to load
32
+ */
33
+ loadProperties(props: string[]): any;
34
+ /**
35
+ * Call a method for this sub device.
36
+ *
37
+ * @param {string} method The method
38
+ * @param {Array} args The arguments
39
+ * @param {object} options Call options
40
+ */
41
+ call(method: string, args: any[], options: object): any;
42
+ [util.inspect.custom](depth: any, options: any): string;
43
+ metadata: Record<string, unknown> & {
44
+ types: string[];
45
+ capabilities: string[];
46
+ addCapabilities(...capabilities: string[]): void;
47
+ };
48
+ init(): Promise</*elided*/ any | undefined>;
49
+ destroy(): Promise<void>;
50
+ debug(...parts: unknown[]): void;
51
+ matches(...tags: string[]): boolean;
52
+ emitEvent(event: string, data?: unknown, options?: unknown): void;
53
+ on(event: string, listener: (...args: never[]) => void): unknown;
54
+ off(event: string, listener: (...args: never[]) => void): unknown;
55
+ extendWith<T>(...mixins: T[]): T & Thing;
56
+ } & Thing;
57
+ export = _exports;
58
+ declare class SubDeviceManagement {
59
+ constructor(device: any, parent: any);
60
+ _device: any;
61
+ parent: any;
62
+ get token(): null;
63
+ get model(): any;
64
+ info(): Promise<{
65
+ id: any;
66
+ model: any;
67
+ }>;
68
+ }
69
+ import util = require("node:util");
70
+ import { Thing } from "abstract-things";
@@ -0,0 +1,49 @@
1
+ declare const _exports: {
2
+ 1: {
3
+ new (parent: any, info: any): import("./switch");
4
+ };
5
+ 2: {
6
+ new (parent: any, info: any): import("./motion");
7
+ };
8
+ 3: {
9
+ new (parent: any, info: any): import("./magnet");
10
+ };
11
+ 7: {
12
+ new (parent: any, info: any): import("./ctrl_neutral2");
13
+ get type(): string;
14
+ };
15
+ 8: {
16
+ new (parent: any, info: any): import("./cube");
17
+ };
18
+ 9: {
19
+ new (parent: any, info: any): import("./ctrl_neutral1");
20
+ get type(): string;
21
+ };
22
+ 10: {
23
+ new (parent: any, info: any): import("./sensor_ht");
24
+ };
25
+ 11: {
26
+ new (parent: any, info: any): import("./plug");
27
+ };
28
+ 19: {
29
+ new (parent: any, info: any): import("./weather");
30
+ };
31
+ 20: {
32
+ new (parent: any, info: any): import("./ctrl_ln1");
33
+ get type(): string;
34
+ };
35
+ 21: {
36
+ new (parent: any, info: any): import("./ctrl_ln2");
37
+ get type(): string;
38
+ };
39
+ 51: {
40
+ new (parent: any, info: any): import("./switch2");
41
+ };
42
+ 52: {
43
+ new (parent: any, info: any): import("./motion2");
44
+ };
45
+ 53: {
46
+ new (...args: any[]): import("./magnet2");
47
+ };
48
+ };
49
+ export = _exports;
@@ -0,0 +1,6 @@
1
+ export = Switch;
2
+ declare class Switch {
3
+ constructor(parent: any, info: any);
4
+ miioModel: string;
5
+ _report(data: any): void;
6
+ }
@@ -0,0 +1,6 @@
1
+ export = Switch;
2
+ declare class Switch {
3
+ constructor(parent: any, info: any);
4
+ miioModel: string;
5
+ _report(data: any): void;
6
+ }
@@ -0,0 +1,23 @@
1
+ declare const _exports: new (...args: any[]) => {
2
+ propertyUpdated(key: any, value: any, oldValue: any): void;
3
+ id: string | null;
4
+ metadata: Record<string, unknown> & {
5
+ types: string[];
6
+ capabilities: string[];
7
+ addCapabilities(...capabilities: string[]): void;
8
+ };
9
+ init(): Promise</*elided*/ any | undefined>;
10
+ initCallback(): Promise<void>;
11
+ destroy(): Promise<void>;
12
+ destroyCallback(): Promise<void>;
13
+ debug(...parts: unknown[]): void;
14
+ matches(...tags: string[]): boolean;
15
+ emitEvent(event: string, data?: unknown, options?: unknown): void;
16
+ on(event: string, listener: (...args: never[]) => void): unknown;
17
+ off(event: string, listener: (...args: never[]) => void): unknown;
18
+ extendWith<T>(...mixins: T[]): T & Thing;
19
+ batteryLevel(): Promise<number>;
20
+ updateBatteryLevel(level: number): void;
21
+ } & Thing;
22
+ export = _exports;
23
+ import { Thing } from "abstract-things";
@@ -0,0 +1,5 @@
1
+ export = WeatherSensor;
2
+ declare class WeatherSensor {
3
+ constructor(parent: any, info: any);
4
+ miioModel: string;
5
+ }