GithubHelp home page GithubHelp logo

megeek / lifxclient Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dclelland/lifxclient

0.0 1.0 0.0 79 KB

Swift client for the LIFX UDP protocol

License: MIT License

Ruby 1.92% Swift 98.08%

lifxclient's Introduction

LIFXClient

Swift client for the LIFX UDP protocol, based on PromiseKit and Apple's Network framework. Supports iOS and macOS.

Currently in use on my macOS 3LED menu bar app: https://github.com/dclelland/3LED

Links

Documentation

Connection

Simple setup:

LIFXClient.connect(host: .ipv4(IPv4Address("192.168.1.4")!)).then { client in
    return client.light.setColor(color: .orange)
}

API

client.device.getService()
client.device.getHostInfo()
client.device.getHostFirmware()
client.device.getWifiInfo()
client.device.getWifiFirmware()
client.device.getPower()
client.device.setPower(on: Bool)
client.device.getLabel()
client.device.setLabel(label: String)
client.device.getVersion()
client.device.getInfo()
client.device.getLocation()
client.device.setLocation(location: Data, label: String, updatedAt: Date)
client.device.getGroup()
client.device.setGroup(group: Data, label: String, updatedAt: Date)
client.device.echo(payload: Data)
client.light.get()
client.light.setColor(color: UIColor, kelvin: UInt16, duration: TimeInterval)
client.light.setWaveform(transient: Bool, color: UIColor, kelvin: UInt16, period: TimeInterval, cycles: Double, dutyCycle: Double, waveform: Waveform)
client.light.setWaveformOptional(transient: Bool, color: UIColor, kelvin: UInt16, period: TimeInterval, cycles: Double, dutyCycle: Double, waveform: Waveform, setHue: Bool, setSaturation: Bool, setBrightness: Bool, setKelvin: Bool)
client.light.getPower()
client.light.setPower(on: Bool, duration: TimeInterval)
client.light.getInfrared()
client.light.setInfrared(brightness: Double)

Wishlist

lifxclient's People

Contributors

dclelland avatar

Watchers

James Cloos avatar

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.