Pako wrote:bengalih wrote:Would you consider something like my changes above ...
That would not be good to make a similar change for backward compatibility.
So I found another solution.
In the main configuration dialog plugin I've added a checkbox "
Use the complete original push as last part of the payload".
You can download the new version 0.2.8.
Pako
(note, I have a few posts after this with multiple changes I did...just want you to be sure to read them all before going to deep into any one!)
Thanks Pako -
In my testing I had changed it to the last payload (after the pushDict) and it didn't seem to have ill effects on anything else, although admittedly I didn't regression test everything.
I have gone ahead and added a new action to the plugin "Dismiss event." This required the addition of the new action and the parsing out of some additional variables in the processMirrorEvent.
I have attached the updated .py as well as my sample tree as an example of what I am doing.
Basically, I wanted to get the mirror notifications to XBMC/Kodi, which wasn't to difficult with the existing plugin (apart from adding the title in as discussed).
What was more challenging was that I was looking to process mirrors for Incoming Calls, and for text messages from Hangouts.
The problem with the text messages from hangouts was that the body that PB sends looks like this for the first text message:
"Hello World Number One!/n"
But if that text message isn't acknowledged, then the next message comes like this:
"Hello World Number One!/n"Hello World Number Two!/n2/n"
and the third:
"Hello World Number One!/n"Hello World Number Two!/n"Hello World Number Three!/n3/n"
Basically, always sending the number of unacknowledged messages along. I could have parsed out the last number, but this had many issues still:
- Sometimes the last last number would be valid (like in "This is the number 1")
- Even if I did this, the whole body gets sent each time so the notification will always be the full text of acknowledged strings, which is quite annoying.
After a lot of deliberation, I decided there really is not foolproof way to handle this and the only option is to dismiss the message when received so that you are always getting a fresh body with each new message.
My EG tree works by toggling notifications on or off at will. When toggled on they will start processing for 2 hours (based on timer) and then auto toggle off.
This is a safety so that I don't dismiss all notifications when I am away from watching XBMC. This happened last night accidentally to me as I left my test running...I kept feeling my phone buzz, but when I looked at it there was no notification! Not until this morning did i realize what happened.
Anyway, hope you will consider including this in the main plugin.
NOTE: For anyone looking to modify the sample EG tree. In the custom script you will want to modify the e-mail address to yours and the device names and friendly names.
It will work without doing this, but the display won't be as "friendly". You also need to modify the plugin properties for XBMC and PB to put in your addresses/creds/api keys.
One final comment on your fix for "Use the complete original push..."
You have nested it under the mirrored notifications, but my purpose in using this is NOT to use your mirror popups, but process my own. Therefore, it probably shouldn't be dependent on using your mirror notifications.
I was still able to get it to work by enabling Mirror popups, checking the "Use the complete..." option, then disabling the mirror popups again.
But, you might want to consider moving it out to the main dialog.
Also, can you please clarify for me use case of:
"The title of the push to use as:" eventSuffix vs. payload[0]
In my use cases I'm not seeing what this modifies or how it could be useful.
Thanks!