Skip to content

Commit

Permalink
🐛 Unregister accessory when configuration was not device
Browse files Browse the repository at this point in the history
  • Loading branch information
dimer47 committed Aug 15, 2021
1 parent 544ca88 commit 1a46c4f
Show file tree
Hide file tree
Showing 6 changed files with 331 additions and 210 deletions.
125 changes: 125 additions & 0 deletions hoobs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"plugin_map": {
"plugin_name": "homebridge-rfxcom-devices"
},
"serialport": "/dev/tty.usbserial-A129KNRC",
"name": "Homebridge RFXCom Devices",
"platform": "HomebridgeRFXComDevices",
"devices": [
{
"uniqueid": "0x0010A127",
"rfid": "0x0010A127",
"type": "button",
"name": "BT Porte Clé",
"manufacturer": "CHACON DiO",
"model": "CH54592",
"serialnumber": "0001",
"entriesid": "unitCode",
"entries": {
"16": {
"name": "command",
"buttons": [
"On"
]
}
}
},
{
"uniqueid": "0x0235A99R",
"rfid": "0x02359C0E",
"type": "button",
"name": "Bouton murale entrée",
"manufacturer": "CHACON DiO",
"model": "54700",
"serialnumber": "0001",
"entriesid": "unitCode",
"entries": {
"1": {
"name": "command",
"buttons": [
"On",
"Off"
]
},
"2": {
"name": "command",
"buttons": [
"On",
"Off"
]
}
}
},
{
"uniqueid": "0x02359E66",
"rfid": "0x02359E66",
"type": "button",
"name": "Bouton murale entrée couloir",
"manufacturer": "CHACON DiO",
"model": "54700",
"serialnumber": "0002",
"firmwarerevision": "0.1",
"entriesid": "unitCode",
"entries": {
"1": {
"name": "command",
"buttons": [
"On",
"Off"
]
},
"2": {
"name": "command",
"buttons": [
"On",
"Off"
]
}
}
},
{
"uniqueid": "0x0235A99E",
"rfid": "0x0235A99E",
"type": "button",
"name": "Bouton murale chambre/couloir",
"manufacturer": "CHACON DiO",
"model": "54700",
"serialnumber": "0003",
"entriesid": "unitCode",
"entries": {
"1": {
"name": "command",
"buttons": [
"On",
"Off"
]
},
"2": {
"name": "command",
"buttons": [
"On",
"Off"
]
}
}
},
{
"uniqueid": "0x01CC19BE",
"rfid": "0x01CC19BE",
"type": "button",
"name": "Bouton murale sonette",
"manufacturer": "CHACON DiO",
"model": "CH84201",
"serialnumber": "0004",
"entriesid": "unitCode",
"entries": {
"1": {
"name": "command",
"buttons": [
"Group On"
]
}
}
}
]
},
28 changes: 28 additions & 0 deletions src/definitions/interfaces.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import {PlatformAccessory, PlatformConfig} from 'homebridge';

interface CustomPlatformConfig extends PlatformConfig{
serialport: string;
devices: Device[];
}
interface DeviceEntries {
name: string;
buttons: string[];
}

interface Device {
UUID: string; // Not present in config file
uniqueid: string;
rfid: string;
type: string;
name: string;
manufacturer: string;
model: string;
serialnumber: string;
firmwarerevision: string;
entriesid: string;
entries: DeviceEntries[];
}

interface CustomPlatformAccessory extends PlatformAccessory {
device: Device;
}
3 changes: 0 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import { API } from 'homebridge';
import { PLATFORM_NAME } from './settings';
import { HomebridgePlatform } from './platform';

/**
* This method registers the platform with Homebridge
*/
export = (api: API) => {
api.registerPlatform(PLATFORM_NAME, HomebridgePlatform);
};
Loading

0 comments on commit 1a46c4f

Please sign in to comment.