Skip to content

Commit

Permalink
Merge pull request #8 from phillipivan/main
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
phillipivan authored Aug 30, 2024
2 parents a6b2f29 + 2a39e88 commit 2836c90
Show file tree
Hide file tree
Showing 6 changed files with 330 additions and 812 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs

This file was deleted.

18 changes: 17 additions & 1 deletion companion/HELP.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ This module will control NTP Audio Routers that support DOT Protocol.
- [NTP Technology Page](https://www.ntp.dk/)

## Configuration

Enter the IP address of the control port of the router controller. The default port is 10005.
In the case of redundant router controllers, enter the secondary controller IP and port, and enable the redundant controllers' switch.
In the case of redundant router controllers, enter the secondary controller IP and port, and enable the redundant controllers' switch.
When the module is enabled, it will try and connect to the Primary, if this fails it will try and connect to the Secondary, and visa-versa. This process typically takes 20 seconds or so, as it relies on the TCP connection going into error before attempting connection to the other controller.

Configure the Source and Destination count, this should be equal to highest index number used for each. The system will limit values entered to the specified range. Refer to the VMC-Config app, Configure>Logical Lines to identify Index values.
Expand All @@ -22,37 +23,52 @@ The alarms should match the number of configured alarm indexes in your system. R
- **Input - P48** Set input phantom power

## Variables

- **Destination - Source** The source routed to a given destination

## Feedbacks

- **Alarm** True if the alarm index is asserted. Alarm text is written to the log. Warn level when asserted, Info level when removed.
- **Crosspoint** True if the specified crosspoint is connected

## Action Recorder

The Action Recorder will translate any connection messages into new connect actions, to quickly build salvos. Other actions are not supported.

## Version History

### Version 1.2.1

- Debounce command queue
- Update dependencies

### Version 1.2.0

- Add variable support for crosspoint feedback
- Convert to ESM
- Minor fixes

### Version 1.1.0

- Add action recorder support

### Version 1.0.4

- Hide redundant config fields when not required

### Version 1.0.3

- Better status updates
- Update dependencies

### Version 1.0.2

- Minor TCP improvements & fixes

### Version 1.0.1

- Update dependencies

### Version 1.0.0

- Initial Release
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"name": "ntp-technology-dot",
"version": "1.2.0",
"version": "1.2.1",
"main": "src/main.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --write",
"lint:raw": "eslint --ext .ts --ext .js --ignore-pattern dist --ignore-pattern pkg",
"lint": "yarn lint:raw ."
"format": "prettier -w .",
"package": "companion-module-build"
},
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/bitfocus/companion-module-ntp-technology-dot.git"
},
"dependencies": {
"@companion-module/base": "~1.8.0"
"@companion-module/base": "~1.10.0"
},
"devDependencies": {
"@companion-module/tools": "^1.5.1"
"@companion-module/tools": "^2.0.0",
"prettier": "^3.3.3"
},
"prettier": "@companion-module/tools/.prettierrc.json"
}
4 changes: 2 additions & 2 deletions src/processcmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export async function processCmd(chunk) {
actionId: 'crosspoint',
options: { dst: dst, src: src, method: control.reqSet },
},
`connect ${dst}`
`connect ${dst}`,
)
}
break
Expand All @@ -312,7 +312,7 @@ export async function processCmd(chunk) {
actionId: 'crosspoint',
options: { dst: dst, src: src, method: control.reqSet },
},
`connect ${dst}`
`connect ${dst}`,
)
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/tcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ import { EndSession, msgDelay, SOM, EOM, keepAliveInterval, control, appTag, par

export function addCmdtoQueue(cmd) {
if (cmd !== undefined && cmd.length > 5) {
this.cmdQueue.push(cmd)
return true
if (this.cmdQueue.includes(cmd) === false) {
this.cmdQueue.push(cmd)
return true
} else {
this.log('debug', `${cmd} already in queue, discarding`)
return false
}

}
this.log('warn', `Invalid command: ${cmd}`)
return false
Expand Down
Loading

0 comments on commit 2836c90

Please sign in to comment.