-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Any way to notify upon check-in fails? #4
Comments
Yes, there are a few ways. I was planning on implementing that soon. Would you prefer a specific way of communication? Email, text message, webhooks, etc? |
Would recommend integrating with https://github.com/caronc/apprise or similar framework so you don't need to reinvent the wheel, but I think simple email should work too |
Apprise looks like a very good option. That’ll cover almost every option a user could want, so I’ll definitely go that route. Thanks! |
I have implemented this feature on the notifications branch. Let me know if you have any issues if you choose to use it. |
Awesome. I tested the branch and the test message works good, but notifications seem not to be triggered when there is a 400 Bad Request error. Tested on my Raspberry pi 4 (Python 3.9.2, maybe it works on Python 3.10?)
|
Might because of auto-southwest-check-in/lib/general.py Line 33 in e7c97eb
has not been implemented |
Oh, there are two places it could raise that error and I only handled it for the actual check in part, not getting the flight times. That’s an easy fix. Would it be useful to get a notification when it succeeds in scheduling a flight or only when it fails? Also, that custom Exception class works fine. I only implemented it to have a custom error name for now. |
👍 |
I added notifications to be sent when scheduling flights on both success and failure. I like the idea of having different levels to sending the notifications. I'll add that in the future as well. |
script works but i cant figure out " python3 southwest.py --test-notifications" I get Invalid Arguments. Below is my config.json which i saved in "auto-southwest-check-in" folder: { I tested apprise and receive a pushbullet notification just fine. What am I missing here?? thanks, |
Hey @molmedo1. Are you on the notifications branch in your repository? You can check by executing the command ‘git branch’ and seeing which branch is highlighted. If you are, can you check the southwest.py file and see if there is a statement ‘if arguments[1] == “—test-notifications”’ on line 7? |
ugh..i wasnt in notifications branch. Switched over and voila..... $ python3 southwest.py --test-notifications Thanks JD! |
That doesn't make sense |
It parses the info, why's it throw the darn exception? Drivin' me nuts! |
Gah! It was staring me right in the face! If I weren't ill, I'd have gotten it earlier. Should be:
|
Hey @helpdeskdan. Are you using Python 3.10+? If you look at the note in the documentation for the isinstance function (https://docs.python.org/3/library/functions.html#isinstance), it says the function now supports Union types. |
I figured it had to be something like that. Ubuntu 20.04 is still on 3.8.10. I'm baffled as to why Gmail striped the \n's (one big paragraph!), but your Python itself appears to work flawlessly with Apprise. Thanks a bunch! |
@helpdeskdan Thanks for mentioning that. I just looked into it and I found out that I can set a default formatting for Apprise to use which would correctly escape the newline characters. Unfortunately, there is a bug in Apprise which makes it not format correctly. It is already fixed, but not in the newest release, so I will wait for that to fix the formatting. In the meantime, you can explicitly add |
That work around works well, thanks for that! I might recommend that minor change to isinstance for backward compatibility, as a many people do not run python 3.10 yet. Minor suggestion: Might be nice to have a separator - if somebody had 4 flights and 8 people, it might be a bit hard to read. Anyway, thanks again for your work! |
That would make sense to make it backwards compatible. I’ll adjust it and test to make sure everything runs correctly. For the suggestion - Are you suggesting something like a blank line after each success/error message? That seems like a good thing to add for the user. Thanks! |
Worked great for me, but I'd expect you would want to test it yourself. As for separation, I mean something like this: Person A Got B-1 Person B Got B-2 Person C Got B-3 Person D Got B-4 Person E Got B-5 Person A got B-10 Person B got B-11 Person C got B-12 Person D got B-13 Person E got B-14 Now, if you wanted to separate each section with "Flight Number XXXX" instead of \n, that would be even better, but a simple carriage return would make it more readable. |
Hey @helpdeskdan. I looked into making a separator when displaying the check-in results. I noticed that on success messages with multiple flights, they seem to be separated correctly already. When I'm testing, this is what I'm seeing with multiple flights:
Is this what you mean when you want it to separate each section? I did notice it not separating correctly for error messages, but I'll fix that. |
Hi @jdholtz just would let you know the notification works good. Thanks for all the work! |
@austinliuu Glad to hear! Thanks for requesting this feature. |
I don't see that at all, I see: Successfully checked in to flight yada yada Person A got yada Person B got yada yada yada big family Person X got yaya Person A got yada Person B got yada ect Curious why you don't see the same. Oh well, not a huge problem. (I'm not exactly a frequent flier) Thanks again for the awesome project, was really handy when I they cancelled my flight three times in a row. |
Interesting. This is what is printed in the terminal, right? |
Not sure, I just know that is how it was in the email |
Okay. I only tested what was printed to the console. You should be receiving only one notification per flight. I’ll look into that |
Is there a way to let the user know if the automated check-in fails so they could do it manually ASAP?
The text was updated successfully, but these errors were encountered: