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

Delayed device notification option #1

Open
ninjamonkey198206 opened this issue May 5, 2018 · 5 comments
Open

Delayed device notification option #1

ninjamonkey198206 opened this issue May 5, 2018 · 5 comments

Comments

@ninjamonkey198206
Copy link

@erocm123

I found the constant delayed devices notifications extremely irritating, so I think I added an option to choose to receive them or not. I really just want to know if the batteries are low, if a device came back online, and if one went online.

I'm not familiar with this language, so I read the code and guessed at what would make that work. Please take a look at the sections I changed and let me know if I've got it right.

I copied and altered the deviceOnline setting option and the test to send notifications.

Also still not fully familiar with github (it seriously confuses me), so I'm sorry about the clunkiness of this.

First change:

input "deviceOnline", "bool", title: "Send a notification if a device comes back online?", required: false, submitOnChange: false, value: false

// Added option for delayed notifications
input "deviceDelayed", "bool", title: "Send a notification listing devices that have had checks delayed?", required: false, submitOnChange: false, value: false

Second change:

// Check if delay notifications wanted
// Original 'if (delaylistCheckMapDiff)'
if (deviceDelayed != null && deviceDelayed.toBoolean() == true && (delaylistCheckMapDiff)) {

@erocm123
Copy link
Contributor

erocm123 commented May 8, 2018

Thanks for this. I will take a look and try it out. :)

@erocm123
Copy link
Contributor

erocm123 commented May 8, 2018

Ok, these changes would be for people that only want ONLINE / OFFLINE notifications and not whether a device hasn't created an event in x hours. I can see that being useful. When this app was originally created, ONLINE / OFFLINE didn't exist so event evaluation was the only method to determine if a device was "offline". I'll add this option in. Thanks for the contribution.

@erocm123
Copy link
Contributor

erocm123 commented May 9, 2018

Added an option to disable "Device Delayed" notifications. Thanks again.

@ninjamonkey198206
Copy link
Author

No problem.

In my testing it still sends messages for devices not sending events, so I was assuming/hoping that the delayed devices were ones that just weren't being checked due to the time settings.

@erocm123
Copy link
Contributor

erocm123 commented May 9, 2018

Gotcha, I actually just added another option to disable "Not Reporting Events" notifications. I haven't tested it, but it is using the same method that you posted for the other notifications. So it should work.

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

2 participants