An open API service indexing awesome lists of open source software.

https://github.com/rogermolas/capacitor-plugin-flic-button


https://github.com/rogermolas/capacitor-plugin-flic-button

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

          

# capacitor-plugin-flic-button

Capacitor plugin support for Flic2 device

## Install

```bash
npm install capacitor-plugin-flic-button
npx cap sync
```

## API

* [`getButtons()`](#getbuttons)
* [`isScanning()`](#isscanning)
* [`scanForButtons()`](#scanforbuttons)
* [`connectButton(...)`](#connectbutton)
* [`disconnectButton(...)`](#disconnectbutton)
* [`removeAllButtons()`](#removeallbuttons)
* [`addListener(string, ...)`](#addlistenerstring-)

### getButtons()

```typescript
getButtons() => Promise<{ buttons: FlicButtonDevice[] }>
```

**Returns:** Promise<{ buttons: FlicButtonDevice[] }>

--------------------

### isScanning()

```typescript
isScanning() => Promise<{ scanning: boolean }>
```

**Returns:** Promise<{ scanning: boolean }>

--------------------

### scanForButtons()

```typescript
scanForButtons() => Promise
```

--------------------

### connectButton(...)

```typescript
connectButton(options: { buttonId: string; }) => Promise<{ message: string; }>
```

| Param | Type |
| ------------- | ---------------------------------- |
| **`options`** | { buttonId: string; } |

**Returns:** Promise<{ message: string; }>

--------------------

### disconnectButton(...)

```typescript
disconnectButton(options: { buttonId: string; }) => Promise<{ message: string; }>
```

| Param | Type |
| ------------- | ---------------------------------- |
| **`options`** | { buttonId: string; } |

**Returns:** Promise<{ message: string; }>

--------------------

### removeAllButtons()

```typescript
removeAllButtons() => Promise<{ message: string; }>
```

**Returns:** Promise<{ message: string; }>

--------------------

### addListener(string, ...)

```typescript
addListener(eventName: string, listenerFunc: (data: any) => void) => Promise
```

| Param | Type |
| ------------------ | ----------------------------------- |
| **`eventName`** | string |
| **`listenerFunc`** | (data: any) => void |

**Returns:** Promise<PluginListenerHandle>