0.1.39
remove old lport, lpath registers (now done via base) change observers name with new :suffixesmaster
parent
9a7fdd9539
commit
6a02b0510e
|
@ -3,3 +3,4 @@
|
||||||
/syncd/
|
/syncd/
|
||||||
*.lock
|
*.lock
|
||||||
*.travis.yml
|
*.travis.yml
|
||||||
|
/.yalc/
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@uci/mcp",
|
"name": "@uci/mcp",
|
||||||
"main": "src",
|
"main": "src",
|
||||||
"version": "0.1.38",
|
"version": "0.1.39",
|
||||||
"description": "Classes and Helper Functions for using the MCP chip on I2C Bus",
|
"description": "Classes and Helper Functions for using the MCP chip on I2C Bus",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"outputs": "./node_modules/.bin/nodemon -r esm --preserve-symlinks examples/outputs",
|
"outputs": "./node_modules/.bin/nodemon -r esm --preserve-symlinks examples/outputs",
|
||||||
|
|
|
@ -19,16 +19,13 @@ class MCP230XX extends Device {
|
||||||
this.commands = this.bindFuncs(commands)
|
this.commands = this.bindFuncs(commands)
|
||||||
this.addNamespace('commands', 's') // allow access to commands via socket/server
|
this.addNamespace('commands', 's') // allow access to commands via socket/server
|
||||||
|
|
||||||
if (opts.lport) this.registerSocket('mcp-t','s','t',{port:opts.lport})
|
this.ready.addObserver('mcp:configure',this.ready.getObserver('i2c:device:ack').pipe(
|
||||||
if (opts.lpath) this.registerSocket('mcp-n','s','n',{path: opts.lpath})
|
|
||||||
|
|
||||||
this.ready.addObserver('mcp',this.ready.getObserver('i2c').pipe(
|
|
||||||
map(async ready => {
|
map(async ready => {
|
||||||
if (ready) {
|
if (ready) {
|
||||||
let res = await this.commands.chip.cfg({cfg:this.chipCfg})
|
let res = await this.commands.chip.cfg({cfg:this.chipCfg})
|
||||||
if (!res.error) {
|
if (!res.error) {
|
||||||
let res = await this.commands.pin.cfgs({configs:this.pinsCfg})
|
let res = await this.commands.pin.cfgs({configs:this.pinsCfg})
|
||||||
return res.error? false :true
|
return res.error? false : true
|
||||||
} return false
|
} return false
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue