Latest 0.0.5
Homepage https://github.com/DCMaxxx/LIFXAPIWrapper
License MIT
Platforms ios 8.0, watchos 2.0, requires ARC
Dependencies AFNetworking
Frameworks UIKit
Authors

Version
License
Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Here’s a quickie :

- (void)doSomeStuffWithTheLIFXAPI
{
    LIFXAPIWrapper *APIWrapper = [LIFXAPIWrapper sharedAPIWrapper];
    [APIWrapper setOAuthToken:@"Your-OAuth-Token"]; // See below how to generate one

    [APIWrapper getAllLightsWithCompletion:^(NSArray *lights) {
    NSLog(@"Fetched all lights: %@", lights);

    LIFXLight *light = lights.firstObject;
    LIFXTargetOperationUpdate *brightnessUpdate = [LIFXTargetOperationUpdate updateWithBrightness:.5];
        [APIWrapper applyUpdate:brightnessUpdate toTarget:light onCompletion:^(NSArray *results) {
            NSLog(@"Brightness update result : %@", results);

        } onFailure:^(NSError *error) {
            NSLog(@"Couldn't appy update: %@", error); 
        }];

    } onFailure:^(NSError *error) {
        NSLog(@"Couldn't fetch lights: %@", error); 
    }];
}

All the classes, methods and property are documented, so you should be able understand it quite easily.

Authentication

The LIFX HTTP API authenticates using an OAuthToken, generate yours on your LIFX Clour settings page.
Unfortunately, username/password combination is NOT supported yet.
All the informations you might need are available on LIFX’s documentation page.

Installation

LIFXAPIWrapper is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "LIFXAPIWrapper"

Author

Maxime de Chalendar, [email protected]

License

LIFXAPIWrapper is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "LIFXAPIWrapper",
    "version": "0.0.5",
    "summary": "An Objective-C wrapper around the LIFX HTTP API",
    "homepage": "https://github.com/DCMaxxx/LIFXAPIWrapper",
    "license": "MIT",
    "authors": {
        "Maxime de Chalendar": "[email protected]"
    },
    "source": {
        "git": "https://github.com/DCMaxxx/LIFXAPIWrapper.git",
        "tag": "0.0.5"
    },
    "social_media_url": "https://twitter.com/DCMaxxx",
    "platforms": {
        "ios": "8.0",
        "watchos": "2.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "LIFXAPIWrapper": [
            "Pod/Assets/*.png"
        ]
    },
    "public_header_files": "Pod/Classes/**/*.h",
    "frameworks": "UIKit",
    "dependencies": {
        "AFNetworking": [
            "~> 2.3"
        ]
    }
}

Pin It on Pinterest

Share This