https://github.com/rogermolas/capacitor-plugin-flic-button
https://github.com/rogermolas/capacitor-plugin-flic-button
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rogermolas/capacitor-plugin-flic-button
- Owner: rogermolas
- License: mit
- Created: 2025-02-25T14:54:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-07T16:04:25.000Z (about 1 year ago)
- Last Synced: 2025-05-07T17:23:08.714Z (about 1 year ago)
- Language: Objective-C
- Size: 14.8 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
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>