mirror of
https://github.com/dtwardow/homebridge-multi-tap-switch.git
synced 2026-11-02 05:18:30 +00:00
Compatibility update for Homebridge 2.0
This commit is contained in:
1 parent
08cbdc46b9
commit
904ad68f6d
9 files changed
+3770
-3767
No files matched your search
@@ -0,0 +1,23 @@
|
||||
import { API, Characteristic, Formats, Perms, Service } from 'homebridge';
|
||||
|
||||
const DISPLAY_NAME = 'Current Scene';
|
||||
const UUID = '290E9D33-0EFC-4640-891E-CC25AAD740EA';
|
||||
|
||||
export function attachCharacteristic_CurrentScene(target: Service, api: API): Characteristic {
|
||||
let result: Characteristic;
|
||||
|
||||
if (target.testCharacteristic(DISPLAY_NAME)) {
|
||||
result = target.getCharacteristic(DISPLAY_NAME)!; // Already tested it exists
|
||||
} else {
|
||||
result = target.addCharacteristic(new api.hap.Characteristic(DISPLAY_NAME, UUID, {
|
||||
format: Formats.UINT8,
|
||||
//unit: '',
|
||||
minValue: 0,
|
||||
maxValue: 0,
|
||||
minStep: 1,
|
||||
perms: [Perms.PAIRED_WRITE, Perms.PAIRED_READ, Perms.NOTIFY],
|
||||
}));
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
Reference in new issue
Block a user