Skip to content

Commit

Permalink
Readability improvements (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
cewbdex committed Apr 10, 2024
1 parent 1fe290f commit 4454611
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 38 deletions.
4 changes: 2 additions & 2 deletions docs/apis/bulk.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Evok Bulk API

The Bulk API is designed to provide an efficient way for clients to update, create or delete large amounts of data. This protocol support multiple write in one request. It is suitable for automated requests thanks JSON protocol, which is better machine-processed.
The Bulk API is designed to provide an efficient way for clients to update, create or delete large amounts of data. This protocol supports multiple writes in one request, but it is suitable for automated requests thanks JSON protocol, which is easily machine-processed.

## Examples

For python examples you need installed 'requests' package. You can install it with this command: `pip3 install requests`.
For python examples you need installed `requests` package. You can install it with this command: `pip3 install requests`.

### Setting DOs to HIGH

Expand Down
4 changes: 2 additions & 2 deletions docs/apis/json.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Evok JSON API

The JSON API provides a simple interface for sending and receiving data in a stateless, cacheable communications. This protocol do not support multiple write in one request. It is suitable for automated requests thanks JSON protocol, which is better machine-processed.
The JSON API provides a simple interface for sending and receiving data in a stateless, cacheable communications. This protocol does not support multiple writes in one request, but it is suitable for automated requests thanks to JSON protocol, which is easily machine-processed.

## Examples

For python examples you need installed 'requests' package. You can install it with this command: `pip3 install requests`.
For python examples you need installed `requests` package. You can install it with this command: `pip3 install requests`.

### Reading DI

Expand Down
4 changes: 2 additions & 2 deletions docs/apis/rest.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Evok REST API

The REST API provides a simple interface for sending and receiving data in a stateless, cacheable communications. This protocol do not support multiple write in one request. It is suitable for hand-make requests.
The REST API provides a simple interface for sending and receiving data in a stateless, cacheable communications. This protocol does not support multiple writes in one request, thus it is suitable mainly for hand-made requests.

## Examples

For python examples you need installed 'requests' package. You can install it with this command: `pip3 install requests`.
For python examples you need installed `requests` package. You can install it with this command: `pip3 install requests`.

### Reading DI

Expand Down
2 changes: 1 addition & 1 deletion docs/apis/rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The RPC (Remote Procedure Call) API is used for invoking procedures, functions o

## Examples

For python examples you need installed 'requests' package. You can install it with this command: `pip3 install requests`.
For python examples you need installed `requests` package. You can install it with this command: `pip3 install requests`.

### Reading DI

Expand Down
6 changes: 3 additions & 3 deletions docs/apis/webhook.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Evok Webhook API

The Webhook API provides a mechanism for pushing real-time updates to clients. Evok sends the changes to the specified hostname and port. A list of reflected devices can be defined. It is suitable for collecting information about the running of the application.
The Webhook API provides a mechanism for pushing real-time updates to clients. Evok sends the changes to the specified hostname and port. A list of reflected devices can be defined. It is suitable for collecting information about the running application.

## Examples

For python examples you need installed 'flask' package. You can install it with this command: `pip3 install flask`.
For python examples you need installed `flask` package. You can install it with this command: `pip3 install flask`.

### Creating simple Webhook server

Expand Down Expand Up @@ -40,7 +40,7 @@ For more information see [Evok configuration](../configs/evok_configuration.md).

!!! note

After you change configuration you must restart the Evok with the command `systemctl restart evok`.
After you change configuration, you have to restart the Evok with the command `systemctl restart evok`.

```bash title="Output"
* Serving Flask app 'server'
Expand Down
4 changes: 2 additions & 2 deletions docs/apis/websocket.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Evok WebSocket API

The WebSocket API allows for two-way communication between the client and server over an open connection. Evok sends changes to every connected client. A list of reflected devices can be defined. It is suitable if you need to immediately react to events in your application.
The WebSocket API allows for two-way communication between the client and the server over an open connection. Evok sends changes to every connected client. A list of reflected devices can be defined. It is suitable for cases, where you need to immediately react to events in your application.

WIP

## Examples

For python examples you need installed 'websocket-client' package. You can install it with this command: `pip3 install websocket-client`.
For python examples you need installed `websocket-client` package. You can install it with this command: `pip3 install websocket-client`.

### Listening on websocket without filter

Expand Down
48 changes: 22 additions & 26 deletions docs/configs/evok_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,19 @@ In this section you can configure address and port for APIs listening. This sett

!!! info

More detailed settings of individual protocols can be found in separate sections.
More detailed settings of individual protocols can be found in their separate section.

### Websocket

- enabled - to enable/disable websocket API
- options: true / false
- all_filtered - 'all' WebSocket requests will be subject to the filtering set by 'filter'
- Options: true / false
- `enabled` - enabling/disabling websocket API (`true` / `false`)
- `all_filtered` - all WebSocket requests will be subject to the filtering set by 'filter' (`true` / `false`)

### Webhook

- enabled - to enable/disable webhook notifications
- Options: true / false
- address - address (with port) to which notifications should be sent
- device_mask
- Address (with port) to which notifications should be sent
- List of device types to notify on (written as a JSON list)
- complex_events - Evok will send POST requests with the same data as WebSocket, rather than an empty GET request
- `enabled` - enabling/disabling webhook notifications (`true` / `false`)
- `address` - address (with port) to which notifications should be sent
- `device_mask` - list of devices to notify on (written as a JSON list, same format as `address`)
- `complex_events` - Evok will send POST requests with the same data as WebSocket, rather than an empty GET request

## Hardware configuration

Expand All @@ -50,24 +45,27 @@ comm_channels:
scan_frequency: 50
```

- <bus_name\>: Your choice, but can not have duplicates!
- <bus_type\>:
- MODBUSTCP (specific settings: [hostname, port])
- MODBUSRTU (specific settings: [port, boudrate, parity])
- <device_name\>: Under this name, the device will be available in the API. Can not have duplicates!
- <model_id\>:
- *<bus_name\>*: Your choice, but has to be unique
- *<bus_type\>* options:
- `MODBUSTCP`
- `hostname` - hostname of the Modbus server
- `port` - port of the Modbus server
- `MODBUSRTU`
- `port` - path to the Modbus device
- `boudrate` - baudrate of the Modbus device
- `parity` - parity of the Modbus device (`N` / `E` / `O`)
- *<device_name\>*: the device will be available in the API under this name. Has to be unique.
- *<model_id\>*:
- Defines a modbus register map.
- Source is located in '.yaml' files in '/etc/evok/hw_definitions'.
- examples: xS51, xS11,
- For more information see [hw_definitions](./hw_definitions.md).
- <slave_id\>: Address of the modbus device.
- scan_frequency:
- An optional parameter that determines how often values are read from the device.
- Default value is 50.
- *<slave_id\>*: Address of the modbus device.
- `scan_frequency` - an optional parameter that determines how often values are read from the device (Default value is 50).

### Examples

Every example must be in section 'comm_channels'.
Every example must be in section `comm_channels`.

#### Define xS51 on /dev/ttyNS0

Expand Down Expand Up @@ -104,9 +102,7 @@ If the Debian package `unipi-os-configurator` is installed, Evok can automatical
/opt/unipi/tools/os-configurator -f
```

Autogen example:

```yaml
```yaml title="Autogen example"
comm_channels:
LOCAL_TCP:
type: MODBUSTCP
Expand Down

0 comments on commit 4454611

Please sign in to comment.