summaryrefslogtreecommitdiffstats
path: root/app/api/Binding.qml
diff options
context:
space:
mode:
authorStephane Desneux <stephane.desneux@iot.bzh>2016-12-14 18:55:59 +0000
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2016-12-15 02:52:46 +0000
commitc472e565e6b7918d0b9554cb1b2c6c86f3ffbef5 (patch)
tree9b72e4b9263dd039e59a435e6b898df43cd8aa3e /app/api/Binding.qml
parent2fec4fc2386bef72c209fbd7fc51d4f4cbfca92a (diff)
app: use range [0..255] for slider, send temperatures updates
Change-Id: I020b2a1c14d09be99e4ecfe645915a666b7759ea Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'app/api/Binding.qml')
-rw-r--r--app/api/Binding.qml15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/api/Binding.qml b/app/api/Binding.qml
index 834bdf8..93da6f4 100644
--- a/app/api/Binding.qml
+++ b/app/api/Binding.qml
@@ -25,6 +25,8 @@ WebSocket {
property string statusString: "waiting..."
property real fanSpeed: 0.0
+ property real leftTemperature: 21.0
+ property real rightTemperature: 21.0
property Connections c : Connections {
target: root
@@ -33,17 +35,28 @@ WebSocket {
console.debug(JSON.stringify(json))
sendTextMessage(JSON.stringify(json))
}
+ onLeftTemperatureChanged: {
+ var json = [MessageId.call, '9999', 'hvac/set', {'LeftTemperature': leftTemperature}]
+ console.debug(JSON.stringify(json))
+ sendTextMessage(JSON.stringify(json))
+ }
+ onRightTemperatureChanged: {
+ var json = [MessageId.call, '9999', 'hvac/set', {'RightTemperature': rightTemperature}]
+ console.debug(JSON.stringify(json))
+ sendTextMessage(JSON.stringify(json))
+ }
}
onTextMessageReceived: {
var json = JSON.parse(message)
var request = json[2].request
var response = json[2].response
+ console.log("HVAC Binding Message: ",message)
switch (json[0]) {
case MessageId.call:
break
case MessageId.retok:
- root.statusString = request.info
+ root.statusString = request.status
break
case MessageId.reterr:
root.statusString = "Bad return value, binding probably not installed"