@dtex/mock-io
Advanced tools
Comparing version 0.0.6 to 0.0.7
class Digital { | ||
static Input = 0x00; | ||
static Output = 0x01; | ||
@@ -10,7 +7,7 @@ constructor(opts) { | ||
this.mode = opts.mode || 0x00; | ||
this.onReadable = opts.onReadable; | ||
if (this.mode === Digital.Input || this.mode === Digital.InputPullUp) { | ||
this.onReadable = opts.onReadable; | ||
} | ||
this.target = opts.target; | ||
this.value = 0x00; | ||
this.Input = 0x00; | ||
this.Output = 0x01; | ||
} | ||
@@ -25,3 +22,3 @@ | ||
this.value = value; | ||
if (this.mode === this.Input) { | ||
if ((this.mode === Digital.Input || this.mode === Digital.InputPullUp) && this.onReadable) { | ||
this.onReadable(); | ||
@@ -38,2 +35,10 @@ } | ||
Digital.Input = 0x00; | ||
Digital.InputPullUp = 0x01; | ||
Digital.InputPullDown = 0x02; | ||
Digital.InputPullUpDown = 0x03; | ||
Digital.Output = 0x08; | ||
Digital.OutputOpenDrain = 0x09; | ||
export default Digital; |
{ | ||
"name": "@dtex/mock-io", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "Mock provider for ECMA-419 IO testing", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5245
139