0.1.16 change logger package location

master
David Kebler 2019-02-26 11:52:08 -08:00
parent 13c8fc329f
commit 655989164b
2 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@uci/i2c-bus",
"version": "0.1.15",
"version": "0.1.16",
"description": "I2c Bus Classes for Communication to I2C bus via socket or direct call",
"main": "src/bus",
"scripts": {
@ -29,11 +29,11 @@
},
"homepage": "https://github.com/uCOMmandIt/i2c#readme",
"optionalDependencies": {
"i2c-bus": "^3.x"
"i2c-bus": "^4.0.7"
},
"dependencies": {
"@uci/base": "^0.1.16",
"@uci-utils/logger": "0.0.13",
"@uci-utils/logger": "^0.0.13",
"better-try-catch": "^0.6.2",
"pify": "^4.0.1"
},

View File

@ -3,7 +3,7 @@ import pify from 'pify'
import btc from 'better-try-catch'
import Base from '@uci/base'
import logger from '@uci/logger'
import logger from '@uci-utils/logger'
let log = {}
class I2CBus extends Base {
@ -17,6 +17,7 @@ class I2CBus extends Base {
if (opts.path) opts.ns = { path: opts.path }
if (!opts.ns) opts.ns = { path: 'i2c-bus' }
opts.sockets = (opts.sockets ? opts.sockets + ',' : '') + 'ns#s>n'
// TODO if port is passed as option then set up tcp with that port
if (opts.tcp) {
if (typeof opts.tcp === 'number') opts.ts = { port: opts.tcp }
else opts.ts = { port: 1776 }
@ -35,6 +36,8 @@ class I2CBus extends Base {
}
// TODO see if default processing of base can handle this now
// if none of these then call the default processor
// could use the default if it included a validation hook plugin
async _packetProcess(sname, packet) {
if (!packet.cmd) return { error: 'no cmd: key in packet', packet: packet }
if (this.bus[packet.cmd]) {