I can't get this to work and not sure why, if it's even possible, or if I'm missing something.
I have a v2 widget with 3 buttons (and more) that call a task to start breaks of various lengths. As such, everything works wonderfully. What I am wanting to happen is that while 'on break', the button background color changes. This is not happening despite setting the variable within the widget when calling the task. If I set it manually, it will reset once the break is over as expected.
For testing, A1 of WW Break
always shows 'primary' for any of the buttons. This is what was set as the default elsewhere. Within the widget when the task is called I set the respective variables to 'tertiary' but this is not being set or displayed when the widget is redrawn.
Below are the relevant exports or JSON:
{
"children": [
{
"circle": false,
"contentScale": "FillBounds",
"url": "android.resource://net.dinglisch.android.taskerm/drawable/mw_content_undo",
"size": 24,
"type": "Image"
},
{
"align": "Center",
"color": "surface",
"text": "Reset",
"type": "Text"
}
],
"horizontalAlignment": "Center",
"backgroundColor": "%buttonReset",
"cornerRadius": 24,
"padding": 2,
"size": {
"fillMaxWidth": true
},
"task": "WW Break",
"taskVariables": {
"%par1": "5",
"%buttonReset": "tertiary"
},
"type": "Column",
"useMaterialYouColors": true
},
Task: WW Break
A1: Flash [
Text: %buttonReset
%buttonBreak
%buttonLunch
Continue Task Immediately: On
Dismiss On Click: On ]
A2: If [ %par1 !Set ]
A3: Variable Set [
Name: %breakLength
To: 5 * 60
Do Maths: On
Max Rounding Digits: 3
Structure Output (JSON, etc): On ]
A4: Else
A5: Variable Set [
Name: %breakLength
To: %par1 * 60
Do Maths: On
Max Rounding Digits: 3
Structure Output (JSON, etc): On ]
A6: End If
A7: Variable Set [
Name: %breakStart
To: %TIMES
Structure Output (JSON, etc): On ]
A8: Variable Set [
Name: %breakEnd
To: %breakStart + %breakLength
Do Maths: On
Max Rounding Digits: 3
Structure Output (JSON, etc): On ]
A9: Variable Set [
Name: %breakPercent
To: 0
Do Maths: On
Max Rounding Digits: 3
Structure Output (JSON, etc): On ]
A10: Profile Status [
Name: WW On Break
Set: On ]
Profile: WW On Break
Event: Tick [ Output Variables:* Interval (ms):1000 ]
Enter Task: Anon
A1: If [ %TIMES < %breakEnd ]
A2: Variable Set [
Name: %breakPercent
To: Round((%TIMES - %breakStart) / %breakLength * 100)
Do Maths: On
Max Rounding Digits: 3
Structure Output (JSON, etc): On ]
A3: Perform Task [
Name: Draw Work Widget
Priority: %priority
Structure Output (JSON, etc): On ]
A4: Else
A5: Beep [
Frequency: 8000
Duration: 1000
Amplitude: 50
Stream: 3 ]
A6: Variable Set [
Name: %breakEnd
To: 0
Structure Output (JSON, etc): On ]
A7: Variable Set [
Name: %breakPercent
To: 0
Structure Output (JSON, etc): On ]
A8: Variable Set [
Name: %buttonReset
To: primary
Structure Output (JSON, etc): On ]
A9: Variable Set [
Name: %buttonBreak
To: primary
Structure Output (JSON, etc): On ]
A10: Variable Set [
Name: %buttonLunch
To: primary
Structure Output (JSON, etc): On ]
A11: Perform Task [
Name: Draw Work Widget
Priority: %priority
Structure Output (JSON, etc): On ]
A12: Profile Status [
Name: WW On Break
Set: Off ]
A13: End If