eliotstocker / Light-Controller

To Control lights from companys such as limitless LED etc
http://eliotstocker.github.io/Light-Controller/
62 stars 24 forks source link

Light Controller API #22

Closed eliotstocker closed 9 years ago

eliotstocker commented 9 years ago

I have begun work on an intent based API, this includes a permission system where by an android package needs to be allowed before light control will begin, i will draw up some specs once its a bit more complete, but so far it is certainly working in a thirdparty text app implementation i wrote.

eliotstocker commented 9 years ago

This is not far off a working version, will update soon with some examples of how you can use the API and an example implementation. :)

mrwhale commented 9 years ago

Awesome! Look forward to having a look at this :)

eliotstocker commented 9 years ago

the API and a simple example can be found at: https://github.com/eliotstocker/Light-ControllerAPI i will be doing further work on this as well as fleshing out examples more but for now you can see where its going, also the main app is now updated with API Permission Manager

eliotstocker commented 9 years ago

im intending to take a look at adding light controller to Comandr soon to allow google now integration using the new API :)

AppLamp-API commented 9 years ago

Also check the easybulb app for some inspiration. They recycled the main connection classes from com.lierda package (MiLight APP) and gave it some intuitive interface to couple/group the lights. Also speech commands and their own timer server. Good your lappie is back :) Cheers, Stijn [logo] http://www.applamp.nl

On 2/16/2015 23:41, Eliot Stocker wrote:

im intending to take a look at adding light controller to Comandr soon to allow google now integration using the new API :)

— Reply to this email directly or view it on GitHub https://github.com/eliotstocker/Light-Controller/issues/22#issuecomment-74583730.

eliotstocker commented 9 years ago

In case anyone would like to have a play with the API as it currently stands here are some APKs a beta build of Light Controller v1.7.0: https://www.dropbox.com/s/eoyv94uqjq4n9dy/LightController-1.7.0b.apk?dl=0 This is required as it contains most of the workings of the new API

Example app that can control the lights, (Doesn't do anything interesting but you can get an idea of what you might be able to do with the api) https://www.dropbox.com/s/l73w0u7xbmb3pgh/Light%20Controller%20API%20Example.apk?dl=0 This uses the new API Client Library (v0.9.1)

Hopefully this will start you guys off in the right directions to creating some awesome apps that will control your lights :D

This API will form the centre of The Alarm Clock and Location Based apps (or plugins in a way, as they will be accessible within light controller)

eliotstocker commented 9 years ago

OK Commandr integration appears to be working, so here we go: a new Light Controller v1.7.0 beta APK: https://www.dropbox.com/s/moi3h7dsrc6rm50/LightController-1.7.0b2.apk?dl=0 (Required)

and my beta release of Commandr: https://www.dropbox.com/s/au48xv4ol00z2r0/Comandr-LightControllerBeta.apk?dl=0

there are two commands added (at the bottom of the list) to turn on and off lights in a spoken zone it will be disabled unless you have v1.7.0+ installed. let me know what you guys think :) also checkout the sources as you can see how simple it was to implement with the new api :)

The permission will be requested on the first successful command, im not sure i love it but currently im not 100% sure of a better way to do it.

mrwhale commented 9 years ago

Nice work! Integration with Commandr is amazing! Luckily my phone is rooted so it looks easy enough to get it working with voice commands from android wear as well. Is there anyway to request the permission on/after installation of the app that requires it? If there is, that could be a more user friendly way

eliotstocker commented 9 years ago

API seems to be functioning correctly :) any issues from now on should be added to the LightController API issue tracker :)