Skip to content

Commit

Permalink
Merge pull request miroRucka#26 from abandonware/sandbox/rzr/review/m…
Browse files Browse the repository at this point in the history
…aster

Merge back abandonware changes
  • Loading branch information
miroRucka authored Feb 25, 2020
2 parents c1beb79 + 03f46b1 commit 6a2944d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/make -f
# -*- makefile -*-
# SPDX-License-Identifier: MIT

default: help all
@echo "log: $@: $^"

tmp_dir ?= tmp
runtime ?= iotjs
export runtime
srcs_dir ?= lib example
srcs ?= $(wildcard *.js | sort | uniq)

main_src ?= example/index.js


help:
@echo "## Usage: "
@echo "# make start"

setup: setup/${runtime}

start/%: ${main_src}
${@F} $< ${run_args}

start: start/${runtime}

clean:
rm -rf ${tmp_dir}

cleanall: clean
rm -f *~

distclean: cleanall
rm -rf node_modules

setup/iotjs: ${iotjs_modules_dir}
@echo "Expected to see IoT.js' help"
${@F} --help ||:
ls $<
8 changes: 7 additions & 1 deletion bh1750.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
var console = require('console');
var i2c = require('i2c');

var i2c = null;
try {
i2c = require('@abandonware/i2c');
} catch(err) {
i2c = require('i2c');
}

var BH1750 = function (opts) {
this.options = opts || {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"version": "0.0.6",
"main": "bh1750",
"scripts": {
"start": "node example",
"test": "node example",
"lint": "eslint ."
},
Expand All @@ -13,7 +14,7 @@
"url": "https://github.com/miroRucka/bh1750"
},
"dependencies": {
"@abandonware/i2c": "^0.2.4-0"
"@abandonware/i2c": "^0.2.4-1"
},
"keywords": [
"raspberry, raspberry pi, light, sensor, bh1750, ambient-light, iotjs-module"
Expand All @@ -25,7 +26,7 @@
}
],
"devDependencies": {
"eslint": "^5.4.0"
"eslint": "^6.8.0"
},
"iotjs": {
"version": ">=1.0"
Expand Down

0 comments on commit 6a2944d

Please sign in to comment.