Code Monkey home page Code Monkey logo

dart_lifx's Introduction

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 most 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)

dart_lifx's People

Contributors

lucaschilders avatar

Stargazers

Flyn Brigden avatar

Watchers

James Cloos avatar  avatar Flyn Brigden avatar

Forkers

guyluz11

dart_lifx's Issues

Will this pacage get null safty

I have been thinking of implementing this package in my project but it is missing null safety support.

Will is package get null safety support?.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.