Coming back to this for a bit. Great to see a BTHome library. Quick and easy device/sensors into HA.
Works great with your example using a singlebutton press. I can see the event on the Home Assistant log.
One thing I can't figure out is how to set up long press and double press events. This sends through both a double and a single press when I hit the puck button once
...
function updateAdvertising() {
NRF.setAdvertising(require("BTHome").getAdvertisement([
{
type : "battery",
v : E.getBattery()
},
{
type : "temperature",
v : E.getTemperature()
},
{
type: "button_event",
v: buttonState ? "press" : "none"
},
{
type: "button_event",
v: buttonState ? "double_press" : "none"
},
]), { name : "Puck" });
...
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Coming back to this for a bit. Great to see a BTHome library. Quick and easy device/sensors into HA.
Works great with your example using a singlebutton press. I can see the event on the Home Assistant log.
One thing I can't figure out is how to set up long press and double press events. This sends through both a double and a single press when I hit the puck button once
Feeling stupid - Thanks