1.0.14 • Published 7 years ago

maker-webtask v1.0.14

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
7 years ago

maker-webtask

Consume message between IFFT (Maker) and other webtask-queue consumers

Setup

  1. Follow the steps to setup a webtask queue
  2. Setup your IFTTT Channel to listen for maker commands at the queue output above. You will want it to POST a body similar to the below:
{
    "device": "<NAME OF DEVICE TO LISTEN FOR>",
    "command": "<SPECIFIC DETAILS TO REACT UPON>"
}
  1. Set an environment variable for the webtask queue above
  2. Set the environment variable MAKER_WEBTASK_URL giving it the above url
  3. Set the environment variable WEBTASK_SECRET giving it the secret used in the step above
  4. Add the package as an NPM package reacting to these commands
var makerWebtask = require('maker-webtask');
var webtaskUrl = ...; // The url from the first step above
function turnOnLight(message) {
  if (message.command === 'on') {
    // Turn light on
  }
}
var pollingInterval = 5; // Check the queue every 5 seconds due to quotas
makerWebtask.run('lightbulb', turnLightOn, pollingInterval);

With the above example, when Maker calls the above URL with the following body:

{
    "device": "lightbulb",
    "command": "on"
}

The light will turn on.

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago