Skip to content

Commit

Permalink
Improve docs (#53)
Browse files Browse the repository at this point in the history
* Add basic docs

* Improve docs

* Move logo to docs

* Fix coverpage and homepage
  • Loading branch information
ottoszika authored Dec 13, 2019
1 parent a86b01b commit 74023e0
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![eWeLink + Node-RED](https://raw.githubusercontent.com/ottoszika/node-red-contrib-ewelink/master/images/ewelink-node-red.png)
![eWeLink + Node-RED](https://raw.githubusercontent.com/ottoszika/node-red-contrib-ewelink/master/docs/images/logo.png)

[![Build Status](https://travis-ci.com/ottoszika/node-red-contrib-ewelink.svg?branch=master)](https://travis-ci.com/ottoszika/node-red-contrib-ewelink)
[![Coverage Status](https://coveralls.io/repos/github/ottoszika/node-red-contrib-ewelink/badge.svg?branch=master)](https://coveralls.io/github/ottoszika/node-red-contrib-ewelink?branch=master)
Expand Down
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![eWeLink + Node-RED](https://raw.githubusercontent.com/ottoszika/node-red-contrib-ewelink/master/images/ewelink-node-red.png)
![eWeLink + Node-RED](images/logo.png)

[GitHub](https://github.com/ottoszika/node-red-contrib-ewelink)
[Get Started](/get-started)
File renamed without changes
Binary file added docs/images/nodes/channels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nodes/device.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nodes/devices.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nodes/event-listener.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nodes/firmware.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nodes/humidity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nodes/power-state-in.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nodes/power-state-out.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nodes/power-usage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nodes/temp-hum.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/nodes/temperature.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<script>
window.$docsify = {
coverpage: true,
homepage: 'get-started.md',
loadSidebar: true,
name: 'node-red-contrib-ewelink',
repo: 'https://github.com/ottoszika/node-red-contrib-ewelink'
Expand Down
75 changes: 60 additions & 15 deletions docs/nodes.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
# Nodes

There are several nodes than can be used to communicate with your devices.
There are several nodes than can be used to communicate with your devices:
* [Devices](#devices-node)
* [Device (generic)](#device-node)
* [Firmware](#firmware-node)
* [Power state (in)](#power-state-in-node)
* [Power state (out)](#power-state-out-node)
* [Channels](#channels-node)
* [Event listener](#event-listener-node)
* [Power usage](#power-usage-node-node)
* [Humidity](#humidity-node)
* [Temperature](#temperature-node)
* [Temperature and humidity](#temp-hum-node)

#### [Devices node](#devices-node)

![](images/nodes/devices.png)

#### Devices node
Using this node you can retrieve all the devices attached to your account.

Result example:
Expand All @@ -19,8 +33,14 @@ Result example:
]
```

#### Device node (generic)
#### [Device node (generic)](#device-node)

![](images/nodes/device.png)

You can communicate with your devices using RPC-like syntax.

A list of all methods you can find here: https://ewelink-api.now.sh/docs/available-methods

The input payload should look like:
```json
{
Expand All @@ -37,7 +57,10 @@ Simple example to turn on a **Sonoff Basic** relay:
}
```

#### Firmware node
#### [Firmware node](#firmware-node)

![](images/nodes/firmware.png)

Returns the current firmware version of a device.

Result example:
Expand All @@ -48,7 +71,10 @@ Result example:
}
```

#### Power state node (in)
#### [Power state node in](#powerstatein-node)

![](images/nodes/power-state-in.png)

Reads the current power state of a single channel device.

Result example:
Expand All @@ -59,7 +85,10 @@ Result example:
}
```

#### Power state node (out)
#### [Power state node (out)](#power-state-out-node)

![](images/nodes/power-state-out.png)

Sets the power state of a single channel device. The payload can be any of the following strings:
* on
* off
Expand All @@ -73,7 +102,10 @@ Result example:
}
```

#### Channels node
#### [Channels node](#channels-node)

![](images/nodes/channels.png)

Returns the number of the channels for the device.

Result example:
Expand All @@ -84,7 +116,10 @@ Result example:
}
```

#### Event listener node
#### [Event listener node](#event-listener-node)

![](images/nodes/event-listener.png)

Listens to events of a devices. When a change occures it will return the event.
By default it listens for events generated by all the devices, but you can specify a single device ID to listen on.

Expand All @@ -99,10 +134,16 @@ Result example:
}
```

#### Power usage node
#### [Power usage node](#power-usage-node)

![](images/nodes/power-usage.png)

Returns the current month power usage on the device.

#### Humidity node
#### [Humidity node](#humidity-node)

![](images/nodes/humidity.png)

Returns the humidity value from the sensor connected to the device.

Result example:
Expand All @@ -113,7 +154,10 @@ Result example:
}
```

#### Temperature node
#### [Temperature node](#temperature-node)

![](images/nodes/temperature.png)

Returns the temperature value from the sensor connected to the device.

Result example:
Expand All @@ -124,7 +168,10 @@ Result example:
}
```

#### Temperature and humidity node
#### [Temperature and humidity node](#temp-hum-node)

![](images/nodes/temp-hum.png)

Returns the temperature and humidity value from the sensor connected to the device.

Result example:
Expand All @@ -136,6 +183,4 @@ Result example:
}
```

[Go to the configuration →](configuration.md)

[← Go back to the installation](installation.md)
[← Go back to the configuration](configuration.md)

0 comments on commit 74023e0

Please sign in to comment.