Skip to content
This repository has been archived by the owner on Mar 19, 2020. It is now read-only.

Feature suggestion: Send update intent / Tasker interface #55

Open
mbirth opened this issue Sep 26, 2013 · 7 comments
Open

Feature suggestion: Send update intent / Tasker interface #55

mbirth opened this issue Sep 26, 2013 · 7 comments
Assignees
Labels
Milestone

Comments

@mbirth
Copy link

mbirth commented Sep 26, 2013

Send an intent on changes to the displayed texts so that we can use a Tasker "Received Intent" filter, to re-use the text in Tasker or maybe even forward it to a custom Zooper Widget.

@ghost ghost assigned rock3r Sep 26, 2013
@rock3r
Copy link
Contributor

rock3r commented Sep 26, 2013

Will definitely do. What extras would you need along with the change? And how would you like it to work when #17 is implemented? Should the intent be launched whenever the message changes (which will happen cyclically even if the weather doesn't change), or just when the weather changes?

@mbirth
Copy link
Author

mbirth commented Sep 26, 2013

Good question! According to http://tasker.dinglisch.net/userguide/en/intents.html you can send multiple extras which are all accessible in Tasker. So maybe you just send the intent whenever the message changes and also include a variable with some weather code. This way, the Tasker script can decide to not do anything if the weather code is the same as before.

The texts should be sent in 2 ways:

  • as whole sentences (e.g. in 2 variables: maintext, subtext)
  • split into 3 parts for highlighting (maybe string arrays: pre-text, keyword, post-text, e.g. ["Slight raining, like a fucking", "pussy", ""] or ["Fucking", "love", "is in the air."])

@rock3r
Copy link
Contributor

rock3r commented Sep 26, 2013

I'm scheduling this for v3.0.

Tentatively, I'll have this intent launched whenever the widget gets updated:

Action: net.frakbot.FWeather.WIDGET_UPDATE
Extras:

  • Integer weatherId with the Yahoo! Weather code for the current weather condition
  • CharSequence weatherString (I'm using a SpannedString for the coloring, and that's what I'd pass through)
  • CharSequence temperatureString (I'm using a SpannedString for the coloring, and that's what I'd pass through)

How would that sound to you? I could pass along the raw HTML instead of the pre-parsed CharSequence, but it'd only be more difficult in the script side to work with it. If the script doesn't care about coloring, it's just as fast as casting the CharSequence to a String to drop all color spans.

@mbirth
Copy link
Author

mbirth commented Sep 26, 2013

I'm not really sure if Tasker provides the necessary methods to cast the SpannedString to a normal String without formatting. But for the moment this should be sufficient. If not, you can maybe add weatherPlainString and temperaturePlainString in a later update.

@rock3r
Copy link
Contributor

rock3r commented Sep 26, 2013

Oh ok I'm not familiar with Tasker's scripting. If you want I'd ask you for
help betatesting this when it's implemented, so that we can find out the
best way to do it.

@mbirth
Copy link
Author

mbirth commented Sep 26, 2013

Sure, it'd be a pleasure! 👍

@rock3r
Copy link
Contributor

rock3r commented Sep 26, 2013

Great then! I'll update this once this is being worked on.

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

No branches or pull requests

2 participants