2.3.0 • Published 2 months ago

mi-service-lite v2.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

MiService

XiaoMi Cloud Service for mi.com

⚡️ Installation

npm install mi-service-lite

# or
yarn add mi-service-lite

# or
pnpm install mi-service-lite

🔥 Usage

import { getMiIOT, getMiNA } from "mi-service-lite";

async function main() {
  console.log("hello world!", process.env.MI_USER);
  const config = {
    userId: process.env.MI_USER!, // Xiaomi Account
    password: process.env.MI_PASS!, // Account Password
    did: process.env.MI_DID, // Device ID or Name (optional - fill in after retrieving from the device list)
  };
  const MiNA = await getMiNA(config);
  const MiIOT = await getMiIOT(config);
  console.log("MiNA devices", await MiNA?.getDevices());
  console.log("MiIOT devices", await MiIOT?.getDevices());
  // Find your device Spec here: https://home.miot-spec.com/
  await MiIOT.doAction(5, 1, "Hello world, 你好!");
}

main();

❤️ Acknowledgement

2.3.0

2 months ago

2.2.0

2 months ago

2.1.0

2 months ago

2.0.1

2 months ago

2.0.0

3 months ago

1.0.0

4 months ago