From b20be30d6f9962833d7213ff546735f318ee0904 Mon Sep 17 00:00:00 2001 From: BigThunderSR <17056173+BigThunderSR@users.noreply.github.com> Date: Thu, 9 Mar 2023 18:34:17 -0600 Subject: [PATCH] Fix for michaelwoods/onstar2mqtt#218 Also added two additional alert options: alertFlash alertHonk --- src/commands.js | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/commands.js b/src/commands.js index 5ebc230..2576f64 100644 --- a/src/commands.js +++ b/src/commands.js @@ -71,14 +71,26 @@ class Commands { return this.onstar.cancelStart(); } - async alert({action = [Commands.CONSTANTS.ALERT_ACTION.FLASH], - delay = 0, duration = 1, override = []}) { - return this.onstar.alert({ - action, - delay, - duration, - override - }); + //async alert({action = [Commands.CONSTANTS.ALERT_ACTION.FLASH], + // delay = 0, duration = 1, override = []}) { + // return this.onstar.alert({ + // action, + // delay, + // duration, + // override + // }); + //} + + async alert() { + return this.onstar.alert(); + } + + async alertFlash({action = [Commands.CONSTANTS.ALERT_ACTION.FLASH]}) { + return this.onstar.alert({action}); + } + + async alertHonk({action = [Commands.CONSTANTS.ALERT_ACTION.HONK]}) { + return this.onstar.alert({action}); } async cancelAlert() { @@ -123,4 +135,4 @@ class Commands { } } -module.exports = Commands; \ No newline at end of file +module.exports = Commands;