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

View File

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