ale

alehos

Use latest alexa v3 with https://github.com/nqd/alehos3

Showing:

Popularity

Downloads/wk

15

GitHub Stars

4

Maintenance

Last Commit

4yrs ago

Contributors

2

Package

Dependencies

0

Size (min+gzip)

1.7KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Alehos, Alexa homeskill built quickly

Build Status JavaScript Style Guide

So that you dont need to write boilerplate code for Alexa Home Skill with Nodejs.

Alehos support routing for the Smart Home Skill API updated February 28, 2017 April 7, 2017 June 22, 2017.

How to use

let Alehos = require('alehos')

let alehos = new Alehos()

alehos.registerHandler('discover', (req, cb) => {
  // get the payload
  cb(null, payload)
})

alehos.registerHandler('onoff', (req, cb) => {
  // check if the request is on/off by looking at req.event.header.name
  // action
  // finally return OK
  cb(null)
})

exports.handler = function(event, context, cb) {
  alehos.handle(event, context, cb)
}

supported functions

  • discover: discovery
  • onoff: turn on and turn off handling
  • temperature: set temperature, increase temperature, decrease temperature handling
  • percentage: set percentage, increase percentage, decrease percentage
  • healthCheck: service availability handling
  • lock: query and controll door lock
  • color: controll tunable lighting
  • camera: query camera streaming

If you don't provide equivalent function, the response will be UnsupportedOperationError.

req

req is actually the event and context object from lambda request. You should looking at event for request message.

cb

cb is the response function.

If you want to return error, generate an new error object, with code of the intented error. Example:

// if the device is un reachable
let err = new Error()
err.code = alehos.code.ERROR_TARGET_OFFLINE
return cb(err)

License

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial