Merge pull request #26 from adafruit/triggers-to-actions

Rename triggers to actions
This commit is contained in:
Justin Cooper 2022-02-17 12:04:02 -06:00 committed by GitHub
commit 8b1b1d4e7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 27 deletions

View file

@ -33,7 +33,7 @@ JSON.stringify({
The double encoded JSON string can be sent directly through Adafruit IO without interference from our processing system, because the processing system will not interpret it as JSON. In your receiving code, because the value passed through includes surrounding double quotes, you have to call your parse function twice to restore the JSON object.
**Important Note:** Data saved in this manner (multiple records saved as JSON in a single feed) will make the data unusable by the IO dashboard and other features such as triggers. IO needs a single value saved into a feed in order to use it in this manner. Saving the JSON objects into a feed is a useful feature if you only need to use the data between two devices, for example.
**Important Note:** Data saved in this manner (multiple records saved as JSON in a single feed) will make the data unusable by the IO dashboard and other features such as actions. IO needs a single value saved into a feed in order to use it in this manner. Saving the JSON objects into a feed is a useful feature if you only need to use the data between two devices, for example.
<% partial 'helpers/inline_code' do %>
```javascript

View file

@ -1,18 +1,18 @@
# Triggers
# Actions
Triggers are a way to do something when a certain situation occurs. There are two kinds of triggers supported at this time: Scheduled and Reactive.
Actions are a way to do something when a certain situation occurs. There are two kinds of actions supported at this time: Scheduled and Reactive.
Scheduled triggers repeatedly perform an action after a scheduled interval.
Scheduled actions repeatedly perform an action after a scheduled interval.
Reactive Triggers are much more advanced, and can integrate basic logic. At a basic level, they check if a feed value is somehow comparable to a value or to even another feed. If so, youll be able to send an email notification, post a webhook or even publish a message to another feed. For example, you can set up a reactive trigger to notify you when the temperature falls below a certain value. When paired with Feed Notification you can easily keep track of the health of your feed and also when somethings gone wrong.
Reactive actions are much more advanced, and can integrate basic logic. At a basic level, they check if a feed value is somehow comparable to a value or to even another feed. If so, youll be able to send an email notification, post a webhook or even publish a message to another feed. For example, you can set up a reactive action to notify you when the temperature falls below a certain value. When paired with Feed Notification you can easily keep track of the health of your feed and also when somethings gone wrong.
## Get All Triggers
## Get All Actions
> HTTP Request
> <div class="http"><span class="method-get">GET</span><code class="path">/api/v2/{username}/triggers</code></div>
> <div class="http"><span class="method-get">GET</span><code class="path">/api/v2/{username}/actions</code></div>
```shell
$ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/triggers
$ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/actions
```
> Response Sample:
@ -25,7 +25,7 @@ $ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/trigge
]
```
An array of triggers
An array of actions
### Path Parameters
@ -36,13 +36,13 @@ username | string | true | a valid username string
## Create Trigger
## Create Action
> HTTP Request
> <div class="http"><span class="method-post">POST</span><code class="path">/api/v2/{username}/triggers</code></div>
> <div class="http"><span class="method-post">POST</span><code class="path">/api/v2/{username}/actions</code></div>
```shell
$ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/triggers
$ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/actions
```
> Response Sample:
@ -53,7 +53,7 @@ $ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/trigge
}
```
New Trigger
New Action
### Path Parameters
@ -71,13 +71,13 @@ trigger | object | true |
## Return Trigger
## Return Action
> HTTP Request
> <div class="http"><span class="method-get">GET</span><code class="path">/api/v2/{username}/triggers/{id}</code></div>
> <div class="http"><span class="method-get">GET</span><code class="path">/api/v2/{username}/actions/{id}</code></div>
```shell
$ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/triggers/{id}
$ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/actions/{id}
```
> Response Sample:
@ -88,7 +88,7 @@ $ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/trigge
}
```
Trigger response
Action response
### Path Parameters
@ -100,13 +100,13 @@ id | string | true |
## Replace Trigger
## Replace Action
> HTTP Request
> <div class="http"><span class="method-put">PUT</span><code class="path">/api/v2/{username}/triggers/{id}</code></div>
> <div class="http"><span class="method-put">PUT</span><code class="path">/api/v2/{username}/actions/{id}</code></div>
```shell
$ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/triggers/{id}
$ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/actions/{id}
```
> Response Sample:
@ -117,7 +117,7 @@ $ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/trigge
}
```
Updated trigger
Updated action
### Path Parameters
@ -136,13 +136,13 @@ trigger | object | true |
## Delete Trigger
## Delete Action
> HTTP Request
> <div class="http"><span class="method-delete">DELETE</span><code class="path">/api/v2/{username}/triggers/{id}</code></div>
> <div class="http"><span class="method-delete">DELETE</span><code class="path">/api/v2/{username}/actions/{id}</code></div>
```shell
$ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/triggers/{id}
$ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/actions/{id}
```
> Response Sample:
@ -151,7 +151,7 @@ $ curl -H "X-AIO-Key: {io_key}" https://io.adafruit.com/api/v2/{username}/trigge
"string"
```
Deleted Trigger successfully
Deleted Action successfully
### Path Parameters

View file

@ -7,7 +7,7 @@ delete objects in your Adafruit IO account. We store the last 1000 actions taken
* Blocks
* Feeds
* Groups
* Triggers
* Actions
## All Activities

View file

@ -33,7 +33,7 @@ includes:
- http/groups.md.erb
- http/webhooks.md.erb
- http/triggers.md.erb
- http/actions.md.erb
- http/activities.md.erb
- http/blocks.md.erb
- http/dashboards.md.erb