myq 1.0.0 icon indicating copy to clipboard operation
myq: ^1.0.0 copied to clipboard

MyQ class (control MyQ garage doors and monitor sensors)

Package myq #

This is a dart package that provides an API to interact with the MyQ garage door openers and sensors.

Usage: #

Create a MyQ account using the Android or iPhone app. You will need your credentials: MYQ_EMAIL and MYQ_PASSWORD. You might want to set these as ENV variables.

Example #

import 'package: myq';

Future<void>main() async {
  try {
    final account = MyQ();
    final login = account.login(MYQ_EMAIL, MYQ_PASSWORD);
  }
  catch (e) {
    print('MyQ login failed');
    exit(1);
  }

  // Logged in account can call these (examine result with debugger to see their structure):
  final result = await account.getDevices(); // get all devices
  
  final result = await account.getDevice(serial_number); // get one device
  
  final result = await account.setDoorState(serial_number, 'OPEN' | 'CLOSED');
  final result = await account.setLightState(serial_number, 'ON' | 'OFF');
}

0
likes
90
pub points
0%
popularity

Publisher

unverified uploader

MyQ class (control MyQ garage doors and monitor sensors)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

ansicolor, crypto, debug, dio, modus_json, statefulemitter

More

Packages that depend on myq