adderlink 2.3.0 copy "adderlink: ^2.3.0" to clipboard
adderlink: ^2.3.0 copied to clipboard

outdated

A dart library for controlling Adderlink devices on an IP network

example/adderlink_example.dart

import 'package:adderlink/adderlink.dart';
import 'package:chopper/chopper.dart';

Future<void> main() async {
  final chopper = ChopperClient(
    baseUrl: Uri.parse("http://192.168.1.100"),
    converter: AlifConverter(),
  );
  var adderlink = AdderlinkService.create(chopper);

  // Login with your username and password
  final l = await adderlink.login(
    username: '',
    password: '',
  );
  final token = l.body?.body?.token;
  if (token == null) throw Exception('Failed to retrieve token');

  try {
    // Get a list of all ALIF devices
    var devices = await adderlink.getDevices(token: token);

    // Print each extender's data to the console
    devices.body?.body?.devices.device.forEach(print);
  } catch (e) {
    print(e);
  } finally {
    // Logout so that the token does not stay active and clog up the auth buffer
    final lr = await adderlink.logout(token: token);

    print(lr.body.toString());
  }
}
0
likes
90
points
129
downloads

Publisher

unverified uploader

Weekly Downloads

A dart library for controlling Adderlink devices on an IP network

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

chopper, dart_mappable, xml2json

More

Packages that depend on adderlink