1.1.2 • Published 4 years ago

miband4 v1.1.2

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

miband4

Simple bluetooth connector for Mi Band 4 (Node.js)

Setup

npm i miband4

Example

Sending notifications

const MiBand4 = require('./index');
const {NOTIFICATION_TYPES} = MiBand4.constants();
const mac = 'E3:4D:12:48:5C:FD'; // set your miband4 address

async function send(message) {
  const mi = new MiBand4();
  await mi.connect(mac);

  const revision = await mi.getRevision();
  const hrdw_revision = await mi.getHRDWRevision();
  const serial = await mi.getSerial();
  const current_time = await mi.getTime();
  const battery = await mi.getBattery();

  console.log({
  	revision,
  	hrdw_revision,
  	serial,
  	current_time,
  	battery,
  })

  await mi.sendNotification(message, NOTIFICATION_TYPES.msg);

  await mi.disconnect();
}

send('Привет world');

Notification types

TypeDescription
msgText with message icon
smsText with sms icon
missedText with missed call icon
callCall notification with text
1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago