The Following 2 Users Say Thank You to Markkyboy For This Useful Post: | ||
|
2019-04-03
, 12:06
|
|
Posts: 433 |
Thanked: 727 times |
Joined on Oct 2012
@ Costa Blanca, Espaņa
|
#22
|
CoverAction { iconSource: "image://theme/icon-cover-location" onTriggered: getData(); function getData(url) { var xhttp = new XMLHttpRequest(); var url = "http://192.168.1.201/cm?cmnd=rfkey1" xhttp.onreadystatechange=function() { if (xhttp.readyState == XMLHttpRequest.DONE) { console.log(xhttp.responseText); mainText.text = xhttp.responseText; } }; xhttp.open("GET", url); xhttp.send(); } } } Label { text: "" id: mainText x: Theme.paddingMedium horizontalAlignment: Text.AlignHCenter font.pixelSize: Theme.fontSizeExtraSmall width: parent.width -x*2 anchors { bottom: cover.bottom bottomMargin: Theme.paddingLarge*4 horizontalCenter: parent.horizontalCenter } Timer { interval: 5000; running: true; onTriggered: mainText.opacity = 0.0; } }
The Following 2 Users Say Thank You to Markkyboy For This Useful Post: | ||
|
2019-04-18
, 16:30
|
|
Posts: 433 |
Thanked: 727 times |
Joined on Oct 2012
@ Costa Blanca, Espaņa
|
#23
|
I need some help with the following;
I'm making a webview app for tasmota, it has 2 preset cover actions; 1 for toggling power of my 'sonoff basic' and the other for my main desk lamp via 'sonoff RF bridge'.
When I press either of my cover action buttons, I get the desired result (light off or on; power off or on), the first press of either button returns the http response data and displays it on the cover, but pressing either of the cover actions after the initial press, the response message is not displayed - why is this response text not repeatable?, what do i need to do so that each time a cover action is pressed, I get the response text displayed.
I think Timer may have something to do with the problem, or does it?,
Here's my code so far;
Code:CoverAction { iconSource: "image://theme/icon-cover-location" onTriggered: getData(); function getData(url) { var xhttp = new XMLHttpRequest(); var url = "http://192.168.1.201/cm?cmnd=rfkey1" xhttp.onreadystatechange=function() { if (xhttp.readyState == XMLHttpRequest.DONE) { console.log(xhttp.responseText); mainText.text = xhttp.responseText; } }; xhttp.open("GET", url); xhttp.send(); } } } Label { text: "" id: mainText x: Theme.paddingMedium horizontalAlignment: Text.AlignHCenter font.pixelSize: Theme.fontSizeExtraSmall width: parent.width -x*2 anchors { bottom: cover.bottom bottomMargin: Theme.paddingLarge*4 horizontalCenter: parent.horizontalCenter } Timer { interval: 5000; running: true; onTriggered: mainText.opacity = 0.0; } }
The Following User Says Thank You to Markkyboy For This Useful Post: | ||
|
2019-04-18
, 16:47
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#24
|
The Following 2 Users Say Thank You to coderus For This Useful Post: | ||
|
2019-04-19
, 08:47
|
Posts: 284 |
Thanked: 661 times |
Joined on Aug 2013
@ Finland
|
#25
|
The Following 2 Users Say Thank You to Thoke For This Useful Post: | ||
|
2019-04-21
, 09:19
|
|
Posts: 433 |
Thanked: 727 times |
Joined on Oct 2012
@ Costa Blanca, Espaņa
|
#26
|
The Following User Says Thank You to Markkyboy For This Useful Post: | ||
|
2019-04-21
, 09:27
|
|
Posts: 433 |
Thanked: 727 times |
Joined on Oct 2012
@ Costa Blanca, Espaņa
|
#27
|
What @coderus said and to explain further the opacity is never set back to 1.0 so it will never return to be visible.
The Following 3 Users Say Thank You to Markkyboy For This Useful Post: | ||
|
2019-04-21
, 10:04
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#28
|
The Following 3 Users Say Thank You to coderus For This Useful Post: | ||
|
2019-05-02
, 10:41
|
|
Posts: 433 |
Thanked: 727 times |
Joined on Oct 2012
@ Costa Blanca, Espaņa
|
#29
|
The Following User Says Thank You to Markkyboy For This Useful Post: | ||
|
2019-05-02
, 10:44
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#30
|
The Following 3 Users Say Thank You to coderus For This Useful Post: | ||
With a few minor changes made in the UI, it is very usable. With this app, you can combine all functions to its 'main page', so no need to see the full Tasmota UI every time, quite handy I thought. Functions can be added to the cover; example: I can turn off my desk lamp from the cover - very handy indeed if you have one particular function you use regularly.
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..