From 27fa77cd537d5999f45bd1615af7841f2e5a0c80 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 6 Aug 2021 18:36:55 +0200 Subject: npm publish? --- install.sh | 7 +++++++ package.json | 3 ++- readme.md | 13 +++++++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 install.sh diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..a7923bc --- /dev/null +++ b/install.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +npm run build + +rm -rf venv +npm run python +sudo npm run perms diff --git a/package.json b/package.json index c64dea3..15e5404 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "scripts": { "build": "tsc", "python": "python3 -m venv venv && venv/bin/pip3 install -r requirements.txt", - "perms": "sudo setcap 'cap_net_raw,cap_net_admin+eip' venv/lib/python3.9/site-packages/bluepy/bluepy-helper" + "perms": "sudo setcap 'cap_net_raw,cap_net_admin+eip' venv/lib/python3.9/site-packages/bluepy/bluepy-helper", + "postinstall": "sh ./install.sh" }, "dependencies": { "@abandonware/noble": "^1.9.2-14", diff --git a/readme.md b/readme.md index 674ce50..ddfc71e 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,18 @@ # homebridge-beken -- a simple homebridge plugin that allows the control of a bulb that goes by many names: +> NOTE: requires python3 +> +> This plugin uses child_process to spawn a python script that does the actual +> communication with the bulb using the bluepy library. Bluepy uses a binary +> called bluepy-helper which should be run as root or given permission to +> directly talk to the bluetooth stack. + +- a simple homebridge plugin that allows the control of a bulb that goes by + many names: - Shada Led's light - iLedBulb - Beken LED -- [here's](https://wiki.fhem.de/wiki/BEKEN_iLedBlub) the bluetooth protocol definition. +- [here's](https://wiki.fhem.de/wiki/BEKEN_iLedBlub) the bluetooth protocol + definition. - sort of stable -- cgit v1.2.3