0.0.3 • Published 5 years ago

turn-touch-element v0.0.3

Weekly downloads
9
License
MIT
Repository
github
Last release
5 years ago

Built With Stencil

<turn-touch>

Web component to interact with a Turn Touch remote using Web Bluetooth.

Learn more about Web Bluetooth: https://steele.blue/web-bluetooth/

Usage

Step 1: Buy a Turn Touch :)

Step 2: Install with a script tag:

<script src="https://unpkg.com/turn-touch-element@0.0.2/dist/mycomponent.js"></script>

Or load with Webpack/Rollup as described here

Step 3: Add the element to your page:

<turn-touch></turn-touch>

Methods

connect(): Connects to the Turn Touch remote

Events

buttonPress: CustomEvent triggered when a button is pressed on the remote.

Contains a detail payload of PressDetails:

interface PressDetails {
  button: ButtonType;
}
type ButtonType =
  | 'Off'
  | 'Up'
  | 'Up Hold'
  | 'Left'
  | 'Left Hold'
  | 'Right'
  | 'Right Hold'
  | 'Down'
  | 'Down Hold';