-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f9ce82
commit d89a0b8
Showing
5 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.01: New App! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Home Assistant Bluetooth LED | ||
|
||
Turn your Bluetooth Espruino device into a LED that can be controlled from Home assistant. | ||
|
||
This uses the [LED BLE Library](https://www.espruino.com/ble_led) which makes Espruino appear as a BLE lightbulb which | ||
is detected by the [LED BLE integration](https://www.home-assistant.io/integrations/led_ble/) in https://www.home-assistant.io/ | ||
|
||
This is based on https://www.espruino.com/BTHome and https://www.espruino.com/Smart+Meter | ||
|
||
## Usage | ||
|
||
Install the app and disconnect, and a device called `LEDBLE` should appear in Home Assistant. Turning it on/off or changing the colour will change the built-in LEDs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require("ble_led").setup(function(state) { | ||
if (state.on) { | ||
// state.r/g/b arr in the range 0..255 | ||
LED1.pwm(state.r/256); | ||
LED2.pwm(state.g/256); | ||
LED3.pwm(state.b/256); | ||
} else { | ||
digitalWrite([LED1,LED2,LED3],0); | ||
} | ||
}); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.