Fix DPT13.
This commit is contained in:
parent
4ba0246211
commit
dcb3d2bea9
25
.vscode/launch.json
vendored
Normal file
25
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Mocha All",
|
||||
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
|
||||
"args": [
|
||||
"-r",
|
||||
"ts-node/register",
|
||||
"--timeout",
|
||||
"999999",
|
||||
"--colors",
|
||||
"${workspaceFolder}/tests/**/*.test.ts",
|
||||
],
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
"protocol": "inspector"
|
||||
},
|
||||
]
|
||||
}
|
@ -33,7 +33,8 @@ export class DPT13 implements DPT {
|
||||
|
||||
if (value === undefined || value === null || !Number.isFinite(value))
|
||||
throw new InvalidValueError(`Value is not viable`)
|
||||
if (Number.isInteger(value))
|
||||
|
||||
if (!Number.isInteger(value))
|
||||
throw new InvalidValueError(`Value ${value} is not an integer`)
|
||||
|
||||
if (value < this.range[0] || value > this.range[1])
|
||||
|
Loading…
Reference in New Issue
Block a user