Skip to content

Commit

Permalink
incremented integration period (Instathings#32)
Browse files Browse the repository at this point in the history
* unified modbus readings into a single mqtt payload

* incremented integration period to 30 seconds and updated herdsman dependency
  • Loading branch information
dadna authored Jan 12, 2023
1 parent f2b35bb commit d53b27a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.6] - 2023-01-12
### Changed
- modbus integration period to 30 seconds

## [1.1.4] - 2022-05-12
### Changed
- Support for linux/amd64 docker image
Expand Down
4 changes: 2 additions & 2 deletions lib/modbus.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Modbus extends events.EventEmitter {
this.model = device.model;
this.modbusId = device.modbus_id;
this.descriptor = modbusHerdsmanConverters.findByModbusModel(this.model);
this.interval = process.env.INTERVAL || 10000;
this.interval = process.env.INTERVAL || 30000;
}

// eslint-disable-next-line class-methods-use-this
Expand Down Expand Up @@ -77,7 +77,7 @@ class Modbus extends events.EventEmitter {
// eslint-disable-next-line no-await-in-loop
value = await promise(address, registersCountToRead);
// eslint-disable-next-line no-await-in-loop
await delay(300);
await delay(1000);
const { post } = addressDescriptor;
const interpreted = registersCountToRead === 1 ? _.get(value, 'data[0]') : value.data;
const raw = _.get(value, 'buffer');
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@instathings/modbus2mqtt",
"version": "1.1.5",
"version": "1.1.6",
"description": "Modbus2MQTT bridge",
"main": "index.js",
"scripts": {
Expand All @@ -14,7 +14,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@instathings/modbus-herdsman-converters": "2.0.5",
"@instathings/modbus-herdsman-converters": "2.0.6",
"fast-deep-equal": "^3.1.1",
"git-last-commit": "^1.0.0",
"js-yaml": "^3.13.1",
Expand Down

0 comments on commit d53b27a

Please sign in to comment.