Latest 1.1.1
Homepage https://github.com/dclelland/LIFXClient
License MIT
Platforms ios 12.0, osx 10.14
Dependencies PromiseKit
Authors

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

Latest podspec

{
    "name": "LIFXClient",
    "version": "1.1.1",
    "summary": "iOS/macOS client for LIFX lightbulbs.",
    "homepage": "https://github.com/dclelland/LIFXClient",
    "license": {
        "type": "MIT"
    },
    "authors": {
        "Daniel Clelland": "[email protected]"
    },
    "source": {
        "git": "https://github.com/dclelland/LIFXClient.git",
        "tag": "1.1.1"
    },
    "platforms": {
        "ios": "12.0",
        "osx": "10.14"
    },
    "swift_versions": "5.0",
    "dependencies": {
        "PromiseKit": [
            "~> 6.8.4"
        ]
    },
    "osx": {
        "source_files": [
            "Sources/Common/**/*.swift",
            "Sources/macOS/**/*.swift"
        ]
    },
    "ios": {
        "source_files": [
            "Sources/Common/**/*.swift",
            "Sources/iOS/**/*.swift"
        ]
    }
}

Pin It on Pinterest

Share This