Go client library for Lelylan API
Lelylan makes it easy for developers to monitor and control all devices in your house providing a simple and consistent REST API.
Install using the Go command line
go get
import (
"github.com/bradrydzewski/go.auth/oauth2"
"github.com/apellizzn/lelylan-go/lelylan"
)
First of all you need an access token to authoraze your requests in Lelylan. To get one use the OAuth2 package and if you are not used to OAuth2 concepts, take 10 minutes and read the related documentation in the dev center.
oauthClient := oauth2.Client {
ClientId: os.Getenv("CLIENT_ID"),
ClientSecret: os.Getenv("CLIENT_SECRET"),
AccessTokenURL: "http://people.lelylan.com/oauth/token"}
token, err := oauthClient.GrantTokenPassword(os.Getenv("USERNAME"), os.Getenv("PASSWORD"), "resources")
Once you have the access token you can access to the Lelylan API. The following example shows how to print in the console a list of owned devices.
client := lelylan.Client{ Token: token }
client.Device(<id here>)
fmt.Println(device.Uri) # get the device uri
fmt.Println(device.Name) # get the device name
Learn how to use Lelylan and AngulasJS in deep.
- Devices.
- Activations.
- Types.
- Properties.
- Functions.
- Statuses.
- Physical devices.
- Subscriptions.
- User Profile.
- OAuth2.
Fork the repo on github and send a pull requests with topic branches. Do not forget to provide specs to your contribution.
- Work in progress
- Work in progress
Follow github guidelines.
Use the issue tracker for bugs. Mail or Tweet us for any idea that can improve the project.
Special thanks to the following people for submitting patches.
See CHANGELOG