Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert Function Does Not Work #218

Closed
BigThunderSR opened this issue Oct 19, 2022 · 2 comments
Closed

Alert Function Does Not Work #218

BigThunderSR opened this issue Oct 19, 2022 · 2 comments

Comments

@BigThunderSR
Copy link
Contributor

BigThunderSR commented Oct 19, 2022

Thanks again for the great work on this!

Everything works for me except for the Alert function. It fails on both my cars. I get the following error whenever I try to run the alert command.

Command Sent:

2022-10-18 20:50:07 info: Command sent {"command":"alert"}

Error from command:

2022-10-18 20:50:07 error: Command error {"command":"alert","err":{"message":"Request Failed with status 400 - Bad Request","request":{"_closed":true,"_contentLength": 74,"_defaultKeepAlive":true,"_ended":true,"_events":{},"_eventsCount":7,"_hasBody":true,"_header":"POST..........................|snip| }

@BigThunderSR
Copy link
Contributor Author

BigThunderSR commented Oct 19, 2022

I changed the following code in commands.js from:

async alert({action = [Commands.CONSTANTS.ALERT_ACTION.FLASH],
             delay = 0, duration = 1, override = []}) {
    return this.onstar.alert({
        action,
        delay,
        duration,
       override
    });
}

To:

async alert() {
    return this.onstar.alert();
}

Which triggers both the lights and the horn which uses the defaults from onstarjs.

I added the following new commands:

async alertFlash({action = [Commands.CONSTANTS.ALERT_ACTION.FLASH]}) {
    return this.onstar.alert({action});  
}

Which triggers the lights only.

async alertHonk({action = [Commands.CONSTANTS.ALERT_ACTION.HONK]}) {
    return this.onstar.alert({action});  
}

Which triggers the horn only.

BigThunderSR added a commit to BigThunderSR/onstar2mqtt that referenced this issue Mar 10, 2023
BigThunderSR added a commit to BigThunderSR/onstar2mqtt that referenced this issue Mar 10, 2023
Also added two additional alert options:
alertFlash
alertHonk
@BigThunderSR
Copy link
Contributor Author

Submitted PR #258 with fix.

Gibby pushed a commit to Gibby/onstar2mqtt that referenced this issue May 19, 2023
Also added two additional alert options:
alertFlash
alertHonk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant