Successfully adding sequences
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
cdab6327f5
commit
5dc28b2409
@ -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);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user