remove old lport, lpath registers (now done via base)
change observers name with new :suffixes
master
David Kebler 2020-01-16 22:03:55 -08:00
parent 9a7fdd9539
commit 6a02b0510e
3 changed files with 4 additions and 6 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/syncd/
*.lock
*.travis.yml
/.yalc/

View File

@ -1,7 +1,7 @@
{
"name": "@uci/mcp",
"main": "src",
"version": "0.1.38",
"version": "0.1.39",
"description": "Classes and Helper Functions for using the MCP chip on I2C Bus",
"scripts": {
"outputs": "./node_modules/.bin/nodemon -r esm --preserve-symlinks examples/outputs",

View File

@ -19,16 +19,13 @@ class MCP230XX extends Device {
this.commands = this.bindFuncs(commands)
this.addNamespace('commands', 's') // allow access to commands via socket/server
if (opts.lport) this.registerSocket('mcp-t','s','t',{port:opts.lport})
if (opts.lpath) this.registerSocket('mcp-n','s','n',{path: opts.lpath})
this.ready.addObserver('mcp',this.ready.getObserver('i2c').pipe(
this.ready.addObserver('mcp:configure',this.ready.getObserver('i2c:device:ack').pipe(
map(async ready => {
if (ready) {
let res = await this.commands.chip.cfg({cfg:this.chipCfg})
if (!res.error) {
let res = await this.commands.pin.cfgs({configs:this.pinsCfg})
return res.error? false :true
return res.error? false : true
} return false
}
return false