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

Faulty trigger when alert before is set to false. #253

Open
HadyMash opened this issue Oct 10, 2023 · 0 comments
Open

Faulty trigger when alert before is set to false. #253

HadyMash opened this issue Oct 10, 2023 · 0 comments

Comments

@HadyMash
Copy link

HadyMash commented Oct 10, 2023

Whenever before is false, a 0M is added before the actual value.

For example the alarm below results in TRIGER:PT0M15M.

alarms: [
            {
              action: 'display',
              description: 'Reminder',
              trigger: { hours: 0, minutes: 15, before: false },
            },
          ],

This is also the case when hour is not 0, for example the alarm below results in TRIGGER:PT0M1H15M

alarms: [
            {
              action: 'display',
              description: 'Reminder',
              trigger: { hours: 1, minutes: 15, before: false },
            },
          ],

A workaround i'm using is fixing the output with regex.

value = value.replace(/TRIGGER:PT0M(.+?)(?=\s|$)/g, 'TRIGGER:PT$1');

I haven't thoroughly tested this, however, so it might not cover all cases.

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