Successfully adding sequences
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Brandon Watson 2021-06-09 17:10:49 -04:00
parent cdab6327f5
commit 5dc28b2409
2 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import { import {
CharacteristicGetCallback, CharacteristicGetCallback,
CharacteristicSetCallback, CharacteristicSetCallback,
CharacteristicValue,
PlatformAccessory, PlatformAccessory,
Service, Service,
} from "homebridge"; } from "homebridge";
@ -73,7 +74,10 @@ export class Sequence {
* Handler for switchSet command * Handler for switchSet command
* @param callback * @param callback
*/ */
public async onSwitchSet(callback: CharacteristicSetCallback): Promise<void> { public onSwitchSet = async (
_value: CharacteristicValue,
callback: CharacteristicSetCallback
): Promise<void> => {
// Execute sequence // Execute sequence
for (const step of this._sequence.Steps) { for (const step of this._sequence.Steps) {
await sleep(step.Delay); await sleep(step.Delay);
@ -97,5 +101,5 @@ export class Sequence {
.updateValue(false); .updateValue(false);
callback(null); callback(null);
} };
} }

View File

@ -15,6 +15,7 @@ import { ISequence } from "./Models/Config/ISequence";
import { HarmonyDevice } from "./Models/HarmonyDevice"; import { HarmonyDevice } from "./Models/HarmonyDevice";
import { HarmonyHub } from "./Models/HarmonyHub"; import { HarmonyHub } from "./Models/HarmonyHub";
import { PLATFORM_NAME, PLUGIN_NAME } from "./settings"; import { PLATFORM_NAME, PLUGIN_NAME } from "./settings";
import { sleep } from "./Util";
export class Platform implements DynamicPlatformPlugin { export class Platform implements DynamicPlatformPlugin {
constructor( constructor(
@ -33,8 +34,10 @@ export class Platform implements DynamicPlatformPlugin {
log: this.log, log: this.log,
}); });
let didFinishLaunching = false;
this.api.on("didFinishLaunching", async () => { this.api.on("didFinishLaunching", async () => {
log.debug("Executed didFinishLaunching callback"); log.debug("Executed didFinishLaunching callback");
didFinishLaunching = true;
}); });
this.dataProvider = null; this.dataProvider = null;