Commit c59417bf authored by Titta Heikkala's avatar Titta Heikkala

Add control for red lights in KNX board

Changing temperature to over 21 will switch the red light in the KNX
board. The initial state of the red light son the board needs to be set
according to default room temperatures.
parent 1f16ff20
......@@ -347,6 +347,23 @@ Item {
home.green = greenColor
presentation.setAttribute(currentTempAttribute, "diffuse.g", greenColor)
}
onEconomyChanged: {
if (knxBackend) {
// Toggle red light based on temperature changes
// The initial state of red lights on the board needs to be based on the default temperatures
var lightNum = 0
if (scene.currentSlideName === "Livingroom")
lightNum = 9
else if (scene.currentSlideName === "Masterbedroom")
lightNum = 10
else if (scene.currentSlideName === "Bedroom")
lightNum = 11
else if (scene.currentSlideName === "Bathroom")
lightNum = 12
knxBackend.toggleLight(lightNum)
}
}
}
}
}
......@@ -56,6 +56,8 @@ SliderControl {
property real blueColor
property real greenColor
property bool economy: currentValue < 22 ? true : false
currentValue: 15
sliderColor: "#0000ff"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment