Skip to content

Commit

Permalink
Improvement fo GUI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed Sep 27, 2024
1 parent 15041dc commit 3a53039
Show file tree
Hide file tree
Showing 12 changed files with 755 additions and 638 deletions.
4 changes: 1 addition & 3 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"require": [
"./test/mocha.setup.js"
]
"require": ["./test/mocha.setup.js"]
}
2 changes: 1 addition & 1 deletion .releaseconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"plugins": ["iobroker", "license"]
"plugins": ["iobroker", "license"]
}
154 changes: 102 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
![Logo](admin/ping.png)

# PING Adapter

![Number of Installations](http://iobroker.live/badges/ping-installed.svg)
Expand All @@ -10,22 +11,26 @@
[![Downloads](https://img.shields.io/npm/dm/iobroker.ping.svg)](https://www.npmjs.com/package/iobroker.ping)

## Pings configured IP addresses.

Pings specified IP addresses in a defined interval and monitors the results.

**This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.** For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.

## Ping from javascript adapter

You can ping any IP address from the JavaScript adapter with command:
```

```js
sendTo('ping.0', 'ping', '192.168.1.1', (res) => {
console.log('Result: ' + JSON.stringify(res)); // Result: {"result": {"host": "192.168.1.1", "alive": true, "ms": 250}}
console.log('Result: ' + JSON.stringify(res)); // Result: {"result": {"host": "192.168.1.1", "alive": true, "ms": 250}}
});
```

## Known Issues
* if it is not possible to ping your linux client, check if `iputils-ping` is correctly installed on a client.

* `ping` command under linux requires root permissions.
- if it is not possible to ping your linux client, check if `iputils-ping` is correctly installed on a client.

- `ping` command under linux requires root permissions.

You can give the adapter the rights to execute the `ping` command as root.

Expand All @@ -41,131 +46,176 @@ You must install `setcap` with `sudo apt-get install libcap2-bin` before if `set
-->

## Todo
- [ ] Implement the possibility to monitor TCP ports

- [ ] Implement the possibility to monitor TCP ports

## Changelog

### **WORK IN PROGRESS**

- (bluefox) Used `iobroker/eslint-config`
- (bluefox) Fixed some errors with `setcup`

### 1.7.6 (2024-09-21)
* (bluefox) Corrected notification message

- (bluefox) Corrected notification message

### 1.7.5 (2024-09-18)
* (bluefox) Corrected small error about range length

- (bluefox) Corrected small error about range length

### 1.7.4 (2024-09-17)
* (bluefox) Added support for dynamic notifications
* (bluefox) Added custom range settings

- (bluefox) Added support for dynamic notifications
- (bluefox) Added custom range settings

### 1.7.3 (2024-08-25)
* (bluefox) Added the functionality to poll the address range periodically

- (bluefox) Added the functionality to poll the address range periodically

### 1.7.1 (2024-08-25)
* (bluefox) Added resolution of IP addresses to MAC addresses

- (bluefox) Added resolution of IP addresses to MAC addresses

### 1.7.0 (2024-08-17)
* (bluefox) Added possibility to browse the IP ranges

- (bluefox) Added possibility to browse the IP ranges

### 1.6.4 (2024-07-17)
* (bluefox) Added possibility to execute `setcap` command to allow ping without root rights

- (bluefox) Added possibility to execute `setcap` command to allow ping without root rights

### 1.6.3 (2024-07-16)
* (bluefox) Updated the packages

- (bluefox) Updated the packages

### 1.6.2 (2023-07-19)
* (McM1957) Handling of state updates causing crashes with js-controller 5 has been corrected. (Issue #106)
* (McM1957) Trailing spaces are now removed from ip address and name. Trailing spaces blocked correct operation. (Issue #98)
* (bluefox) Added JSON config
* (bluefox) Added different intervals for online and offline devices
* (bluefox) implemented export/import of devices

- (McM1957) Handling of state updates causing crashes with js-controller 5 has been corrected. (Issue #106)
- (McM1957) Trailing spaces are now removed from ip address and name. Trailing spaces blocked correct operation. (Issue #98)
- (bluefox) Added JSON config
- (bluefox) Added different intervals for online and offline devices
- (bluefox) implemented export/import of devices

### 1.5.3 (2022-02-24)
* (Apollon77) Fix the ping retry logic

- (Apollon77) Fix the ping retry logic

### 1.5.2 (2022-01-20)
* (basti4557) Number of retries can be defined if a ping request failed. This should minimize wrong offline detection.

- (basti4557) Number of retries can be defined if a ping request failed. This should minimize wrong offline detection.

### 1.5.0 (2021-07-14)
* js-controller 2.0 required at least
* (Apollon77) optimize for js-controller 3.3

- js-controller 2.0 required at least
- (Apollon77) optimize for js-controller 3.3

### 1.4.12 (2020-09-18)
* (Apollon77) Prevented a crash case when no devices are defined (Sentry IOBROKER-PING-R)

- (Apollon77) Prevented a crash case when no devices are defined (Sentry IOBROKER-PING-R)

### 1.4.11 (2020-08-26)
* (Apollon77) update js-controller dependency to correct version (1.5.8)

- (Apollon77) update js-controller dependency to correct version (1.5.8)

### 1.4.8 (2020-06-29)
* (Apollon77) Prevent adapter crashes with invalid state/channel names, see error log! (Sentry IOBROKER-PING-H, IOBROKER-PING-P, IOBROKER-PING-B)

- (Apollon77) Prevent adapter crashes with invalid state/channel names, see error log! (Sentry IOBROKER-PING-H, IOBROKER-PING-P, IOBROKER-PING-B)

### 1.4.7 (2020-05-02)
* (Apollon77) finally try to catch spawn errors (Sentry IOBROKER-PING-2)

- (Apollon77) finally try to catch spawn errors (Sentry IOBROKER-PING-2)

### 1.4.6 (2020-04-29)
* (Apollon77) Make sure the adapter does not crash if ping command cannot be executed (Sentry)
* (Apollon77) Catch error when `ping.probe` could not be started (Sentry IOBROKER-PING-2)

- (Apollon77) Make sure the adapter does not crash if ping command cannot be executed (Sentry)
- (Apollon77) Catch error when `ping.probe` could not be started (Sentry IOBROKER-PING-2)

### 1.4.5 (2020-04-23)
* (Apollon77) Fixed a potential crash case (Sentry)

- (Apollon77) Fixed a potential crash case (Sentry)

### 1.4.4 (2020-04-17)
* (bluefox) Added support for Admin3

- (bluefox) Added support for Admin3

### 1.4.3 (2020-04-17)
* (Apollon77) Add Sentry for js-controller 3.0
* (Apollon77) update dependencies

- (Apollon77) Add Sentry for js-controller 3.0
- (Apollon77) update dependencies

### 1.4.2 (2020-01-23)
* (JayVee2) Sort the IP addresses

- (JayVee2) Sort the IP addresses

### 1.4.1 (2019-01-08)
* (simatec) supported compact mode

- (simatec) supported compact mode

### 1.4.0 (2018-01-25)
* (vdemidov) refactored, added ping time and roundtrips per second for every host

- (vdemidov) refactored, added ping time and roundtrips per second for every host

### 1.3.2 (2017-09-20)
* (ldittmar) object values are converted to the valid type

- (ldittmar) object values are converted to the valid type

### 1.3.0 (2017-02-21)
* (bluefox) allowed removing host name from state's name

- (bluefox) allowed removing host name from state's name

### 1.2.0 (2016-12-09)
* (bluefox) change configuration dialog

- (bluefox) change configuration dialog

### 1.1.3 (2016-11-16)
* (bluefox) catch error if no IP defined

- (bluefox) catch error if no IP defined

### 1.1.1 (2016-04-10)
* (bluefox) remove ms

- (bluefox) remove ms

### 1.1.0 (2016-04-10)
* (bluefox) rewrite ping for windows

- (bluefox) rewrite ping for windows

### 1.0.0 (2016-04-03)
* (bluefox) support for freebsd and all windows languages
* (bluefox) add tests

- (bluefox) support for freebsd and all windows languages
- (bluefox) add tests

### 0.1.3 (2015-01-26)
* (bluefox) Fixed the error if the configuration changed

- (bluefox) Fixed the error if the configuration changed

### 0.1.2 (2015-01-14)
* (bluefox) Fixed the configuration page

- (bluefox) Fixed the configuration page

### 0.1.1 (2015-01-03)
* (bluefox) Enabled npm install

- (bluefox) Enabled npm install

### 0.1.0 (2014-11-26)
* (bluefox) Used ping npm module instead of static one

- (bluefox) Used ping npm module instead of static one

### 0.0.5 (2014-11-21)
* (bluefox) Made possible to have shorter ping intervals (down to 5 seconds)

- (bluefox) Made possible to have shorter ping intervals (down to 5 seconds)

### 0.0.4 (2014-11-07)
* (bluefox) fix ping node

- (bluefox) fix ping node

### 0.0.3 (2014-11-03)
* (bluefox) fix ping node (do not forget to remove package from git when the npm gets the update)

- (bluefox) fix ping node (do not forget to remove package from git when the npm gets the update)

### 0.0.1 (2014-11-02)
* (bluefox) support of server (actually no authentication)

- (bluefox) support of server (actually no authentication)

## License

Expand Down
21 changes: 21 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import config from '@iobroker/eslint-config';

// disable temporary the rule 'jsdoc/require-param' and enable 'jsdoc/require-jsdoc'
config.forEach(rule => {
if (rule?.plugins?.jsdoc) {
rule.rules['jsdoc/require-jsdoc'] = 'off';
rule.rules['jsdoc/require-param'] = 'off';
}
});

export default [
...config,
...[
{
files: ['**/*.js'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
],
];
Loading

0 comments on commit 3a53039

Please sign in to comment.