|
|
2020-09-03
, 16:14
|
|
|
Posts: 433 |
Thanked: 727 times |
Joined on Oct 2012
@ Costa Blanca, España
|
#122
|
Rectangle {
id: mainLights1
width: 80
height: 80
radius: 40
color: "transparent"
border.color: "yellow"
border.width: mini1.pressed ? 4 : 2
MouseArea {
id: mini1
anchors.fill: parent
onClicked: {
var xhttp = new XMLHttpRequest()
xhttp.onreadystatechange = function() {
if (xhttp.readyState === 4 && xhttp.status === 200) {
led.opacity = 1.0
timer.start()
vibrate.start()
mainLights1.radius = 40
mainLights1.border.color = "green" <-- ON, color is green
console.log("Main light1" + " " + xhttp.responseText)
}
else mainLights1.radius = 20
}
xhttp.open("POST", "http://192.168.0.230/cm?cmnd=cmnd/mini1/power toggle")
xhttp.send()
}
}
Label { text: "<b>PATIO</b>" ; anchors.centerIn: parent; color: "white"; font.pixelSize: Theme.fontSizeTiny }
}
| The Following User Says Thank You to Markkyboy For This Useful Post: | ||
|
|
2020-09-03
, 18:05
|
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#123
|
| The Following User Says Thank You to coderus For This Useful Post: | ||
|
|
2020-09-03
, 18:37
|
|
|
Posts: 433 |
Thanked: 727 times |
Joined on Oct 2012
@ Costa Blanca, España
|
#124
|
mainLights1 "{"POWER":"ON"}"
| The Following User Says Thank You to Markkyboy For This Useful Post: | ||
|
|
2020-09-03
, 21:07
|
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#125
|
mainLights1.border.color = JSON.parse(xhttp.responseText).POWER == 'ON' ? "green" : "red"
| The Following 5 Users Say Thank You to coderus For This Useful Post: | ||
|
|
2020-09-04
, 21:50
|
|
|
Posts: 433 |
Thanked: 727 times |
Joined on Oct 2012
@ Costa Blanca, España
|
#126
|
Code:mainLights1.border.color = JSON.parse(xhttp.responseText).POWER == 'ON' ? "green" : "red"
| The Following User Says Thank You to Markkyboy For This Useful Post: | ||
|
|
2020-09-06
, 16:11
|
|
Posts: 301 |
Thanked: 531 times |
Joined on Aug 2010
@ The Netherlands
|
#127
|
| The Following User Says Thank You to rob_kouw For This Useful Post: | ||
|
|
2020-09-06
, 20:05
|
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#128
|
coderus, I read something about a FileModel. The post referred to your GitHub page, but the files have been removed from there. Is it possible to view them somewhere else?
| The Following User Says Thank You to coderus For This Useful Post: | ||
|
|
2020-09-07
, 07:06
|
|
Posts: 301 |
Thanked: 531 times |
Joined on Aug 2010
@ The Netherlands
|
#129
|
| The Following User Says Thank You to rob_kouw For This Useful Post: | ||
|
|
2020-09-07
, 12:30
|
|
|
Posts: 6,436 |
Thanked: 12,701 times |
Joined on Nov 2011
@ Ängelholm, Sweden
|
#130
|
Sure. For my app (pure QML/JS now) I would like to have the possibility to select a file in Downloads, and the content into a variable.
Telegram | Openrepos | GitHub | Revolut donations