mirror of
https://github.com/dtwardow/homebridge-multi-tap-switch.git
synced 2026-11-02 05:18:30 +00:00
Updated code comments, by introducing function documentations
This commit is contained in:
1 parent
2181b42bba
commit
3fc96b63ed
2 files changed
+63
-17
No files matched your search
+19
-1
@@ -28,6 +28,12 @@ export class MultiTapSwitchPlatform implements DynamicPlatformPlugin {
|
||||
|
||||
public readonly Config: PluginConfig;
|
||||
|
||||
/**
|
||||
* Construct the Homebridge platform
|
||||
* @param log Homebridge Logger
|
||||
* @param config Homebridge Configuration (from config.json)
|
||||
* @param api Homebridge API
|
||||
*/
|
||||
constructor(
|
||||
public readonly log: Logger,
|
||||
public readonly config: PlatformConfig,
|
||||
@@ -55,17 +61,29 @@ export class MultiTapSwitchPlatform implements DynamicPlatformPlugin {
|
||||
{value: this.CharacteristicTriggerTimeout});
|
||||
}
|
||||
|
||||
/**
|
||||
* Homebridge Accessory Configuration Callback
|
||||
* @param accessory Accessory to previously added by this platform
|
||||
*/
|
||||
configureAccessory(accessory: PlatformAccessory) {
|
||||
this.log.info('Load cached Accessory:', accessory.displayName);
|
||||
|
||||
// add the restored accessory to the accessories cache so we can track if it has already been registered
|
||||
// add the restored accessory to the accessories cache, so we can track if it has already been registered
|
||||
this.accessories.push(accessory);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the UUIDs
|
||||
* @param name Name to use for the calculation
|
||||
* @param serial (optional) Provide an additional number (might be obsolete in future releases)
|
||||
*/
|
||||
defineUuid(name: string | undefined, serial = 'UNDEF'): string {
|
||||
return this.api.hap.uuid.generate(name + '_' + serial);
|
||||
}
|
||||
|
||||
/**
|
||||
* Discover new and existing accessories
|
||||
*/
|
||||
discoverDevices() {
|
||||
const parsedConfig = new PluginConfig(this.config);
|
||||
for (const device of parsedConfig.Devices) {
|
||||
|
||||
Reference in new issue
Block a user