Skip to main content

Button

synapse.binary_sensor is a simple entity for reflecting a non-user-controllable binary state as an entity.

Home Assistant Counterpart

✏️ Usage

minimum properties

synapse.button({
context,
name: "My button entity"
});

Entity specific attributes

⚙️ Configuration

device_class

  • identify
  • restart
  • update

🌐 Events

press / onPress

const entity = synapse.button({
press() {
logger.info("do the thing");
}
});

entity.onPress(() => {
logger.info("I was pressed!");
});