lifx 0.2.0 copy "lifx: ^0.2.0" to clipboard
lifx: ^0.2.0 copied to clipboard

outdatedDart 1 only

A simple library to interact with LIFX lights. Currently contains 5 methods used to interact with lights.

dart_lifx #

Another attempt at a LIFX library, this time written in Dart.

  • Requires LIFX API key when creating a new object.
  • Optional named parameter, loggingEnabled enables or disables status codes and response body printing.
import 'package:lifx/lifx.dart';

void main() {
    var lifx = new LIFX("api_key_here", loggingEnabled: true);

    lifx.getLights().then((res) => print(res));
}

Methods #

All methods are asynchronous and contain optional light parameter, by default all lights are selected. Pass light ID, found with getLights() to control individual lights.

Read more about setState here.

Future<Map> getLights({String light = "all"})
Future<Map> getScenes()
Future<bool> activateScene(String uuid, {double duration = 1.0})
Future<bool> togglePower({String light = "all"}) 
Future<bool> setState({String light = "all", String power = "on", String color = "", double brightness = 0.5, double duration = 1.5, double infrared = 0.0})

Extra #

Gets the hexidecimal value from standard RGB (0 - 255) values to easily set color in setState().

String getHexFromRGB(int red, int green, int blue)
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A simple library to interact with LIFX lights. Currently contains 5 methods used to interact with lights.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

convert, hex, http, json_object, unittest

More

Packages that depend on lifx