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

How to retrieve all alarms in the script #1512

Closed
s5314203 opened this issue Nov 27, 2024 · 3 comments
Closed

How to retrieve all alarms in the script #1512

s5314203 opened this issue Nov 27, 2024 · 3 comments
Labels

Comments

@s5314203
Copy link

How to retrieve all alarms in the script

@unocelli
Copy link
Member

I'm working on this feature

@unocelli
Copy link
Member

unocelli commented Dec 1, 2024

I just added the feature in master branch

const activeAlarms = await $getAlarms();
/* result in activeAlarms = [
{
"name": "temperature^~^highhigh",
"type": "highhigh",
"ontime": 1733074995709,
"offtime": 1733075016983,
"acktime": 0,
"status": "NF",
"text": "Alarm temperature",
"bkcolor": "#FF4848",
"color": "#FFF",
"toack": 1
}, {...}
] */

const ackResult = await $ackAlarm('temperature', ['highhigh', 'high']); // to ack 'highhigh' and 'high of alarm temperature
/* result ackResult = [true, ...] */

@unocelli
Copy link
Member

I’m going to close this as resolved. let me know if you have any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants