yeedart 0.1.2 copy "yeedart: ^0.1.2" to clipboard
yeedart: ^0.1.2 copied to clipboard

outdated

Simple Dart library that lets you control Yeelight devices over LAN.

example/yeedart_example.dart

import 'dart:io';

import 'package:yeedart/yeedart.dart';

Future<void> main() async {
  // Discover devices
//  final responses = await Yeelight.discover();
//  final response = responses.first;
//  final device = Device(address: response.address, port: response.port);
//  device.turnOn();
//  await Future<void>.delayed(const Duration(seconds: 3));
//  device.turnOff();
//  device.disconnect();

  // Connect directly to device
  final device = Device(
    address: InternetAddress('192.168.1.183'),
    port: 55443,
  );

  // ignore: avoid_print
  print(await device.getProps(id: 1, parameters: [
    'name',
    'model',
    'fw_ver',
    'power',
    'color_mode',
    'bright',
    'ct',
    'rgb',
    'hue',
    'sat',
  ]));

  await device.turnOn();
  await Future<void>.delayed(const Duration(seconds: 3));
  await device.turnOff();
  device.disconnect();
}
11
likes
0
points
34
downloads

Publisher

verified publisherstol.dev

Weekly Downloads

Simple Dart library that lets you control Yeelight devices over LAN.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, meta

More

Packages that depend on yeedart