From 6a02b0510eefe9251b3591426127a40743275abf Mon Sep 17 00:00:00 2001 From: David Kebler Date: Thu, 16 Jan 2020 22:03:55 -0800 Subject: [PATCH] 0.1.39 remove old lport, lpath registers (now done via base) change observers name with new :suffixes --- .gitignore | 1 + package.json | 2 +- src/mcp230xx.js | 7 ++----- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 1a359fd..b9e74b5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /syncd/ *.lock *.travis.yml +/.yalc/ diff --git a/package.json b/package.json index 242ddcd..86f0c96 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/mcp230xx.js b/src/mcp230xx.js index a65d260..c1dfbfa 100644 --- a/src/mcp230xx.js +++ b/src/mcp230xx.js @@ -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