Update gas interface
This commit is contained in:
parent
e66a1cd3cc
commit
f7b392cc04
@ -321,7 +321,7 @@ MainPageTile {
|
|||||||
ListElement { ifaceName: "firesensor"; stateName: "fireDetected" }
|
ListElement { ifaceName: "firesensor"; stateName: "fireDetected" }
|
||||||
ListElement { ifaceName: "cosensor"; stateName: "co" }
|
ListElement { ifaceName: "cosensor"; stateName: "co" }
|
||||||
ListElement { ifaceName: "co2sensor"; stateName: "co2" }
|
ListElement { ifaceName: "co2sensor"; stateName: "co2" }
|
||||||
ListElement { ifaceName: "gassensor"; stateName: "gas" }
|
ListElement { ifaceName: "gassensor"; stateName: "gasLevel" }
|
||||||
ListElement { ifaceName: "conductivity"; stateName: "conductivity" }
|
ListElement { ifaceName: "conductivity"; stateName: "conductivity" }
|
||||||
ListElement { ifaceName: "noisesensor"; stateName: "noise" }
|
ListElement { ifaceName: "noisesensor"; stateName: "noise" }
|
||||||
ListElement { ifaceName: "smartmeterconsumer"; stateName: "currentPower" }
|
ListElement { ifaceName: "smartmeterconsumer"; stateName: "currentPower" }
|
||||||
|
|||||||
@ -239,7 +239,7 @@ MainPageTile {
|
|||||||
tmp.push({iface: "co2sensor", state: "co2"});
|
tmp.push({iface: "co2sensor", state: "co2"});
|
||||||
}
|
}
|
||||||
if (thing.thingClass.interfaces.indexOf("gassensor") >= 0) {
|
if (thing.thingClass.interfaces.indexOf("gassensor") >= 0) {
|
||||||
tmp.push({iface: "gassensor", state: "gas"});
|
tmp.push({iface: "gassensor", state: "gasLevel"});
|
||||||
}
|
}
|
||||||
if (thing.thingClass.interfaces.indexOf("smartmeterconsumer") >= 0) {
|
if (thing.thingClass.interfaces.indexOf("smartmeterconsumer") >= 0) {
|
||||||
tmp.push({iface: "smartmeterconsumer", state: "currentPower"});
|
tmp.push({iface: "smartmeterconsumer", state: "currentPower"});
|
||||||
|
|||||||
@ -82,7 +82,7 @@ ThingsListPageBase {
|
|||||||
ListElement { interfaceName: "noisesensor"; stateName: "noise" }
|
ListElement { interfaceName: "noisesensor"; stateName: "noise" }
|
||||||
ListElement { interfaceName: "cosensor"; stateName: "co" }
|
ListElement { interfaceName: "cosensor"; stateName: "co" }
|
||||||
ListElement { interfaceName: "co2sensor"; stateName: "co2" }
|
ListElement { interfaceName: "co2sensor"; stateName: "co2" }
|
||||||
ListElement { interfaceName: "gassensor"; stateName: "gas" }
|
ListElement { interfaceName: "gassensor"; stateName: "gasLevel" }
|
||||||
ListElement { interfaceName: "daylightsensor"; stateName: "daylight" }
|
ListElement { interfaceName: "daylightsensor"; stateName: "daylight" }
|
||||||
ListElement { interfaceName: "presencesensor"; stateName: "isPresent" }
|
ListElement { interfaceName: "presencesensor"; stateName: "isPresent" }
|
||||||
ListElement { interfaceName: "closablesensor"; stateName: "closed" }
|
ListElement { interfaceName: "closablesensor"; stateName: "closed" }
|
||||||
|
|||||||
@ -48,7 +48,7 @@ ThingPageBase {
|
|||||||
"noisesensor": "noise",
|
"noisesensor": "noise",
|
||||||
"cosensor": "co",
|
"cosensor": "co",
|
||||||
"co2sensor": "co2",
|
"co2sensor": "co2",
|
||||||
"gassensor": "gas",
|
"gassensor": "gasLevel",
|
||||||
"presencesensor": "isPresent",
|
"presencesensor": "isPresent",
|
||||||
"daylightsensor": "daylight",
|
"daylightsensor": "daylight",
|
||||||
"closablesensor": "closed",
|
"closablesensor": "closed",
|
||||||
@ -338,6 +338,10 @@ ThingPageBase {
|
|||||||
property var minValue: parent.minValue
|
property var minValue: parent.minValue
|
||||||
property var maxValue: parent.maxValue
|
property var maxValue: parent.maxValue
|
||||||
|
|
||||||
|
property double progress: (progressCanvas.state.value - progressCanvas.minValue) / (progressCanvas.maxValue - progressCanvas.minValue)
|
||||||
|
Behavior on progress { NumberAnimation { duration: Style.slowAnimationDuration; easing.type: Easing.InOutQuad } }
|
||||||
|
onProgressChanged: requestPaint();
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width * 0.6
|
width: parent.width * 0.6
|
||||||
@ -372,8 +376,7 @@ ThingPageBase {
|
|||||||
|
|
||||||
ctx.beginPath()
|
ctx.beginPath()
|
||||||
ctx.strokeStyle = app.interfaceToColor(progressCanvas.interfaceName)
|
ctx.strokeStyle = app.interfaceToColor(progressCanvas.interfaceName)
|
||||||
var progress = (progressCanvas.state.value - progressCanvas.minValue) / (progressCanvas.maxValue - progressCanvas.minValue)
|
radEnd *= progressCanvas.progress
|
||||||
radEnd *= progress
|
|
||||||
ctx.arc(0, 0, width / 2 - ctx.lineWidth / 2, radStart, radEnd)
|
ctx.arc(0, 0, width / 2 - ctx.lineWidth / 2, radStart, radEnd)
|
||||||
ctx.stroke()
|
ctx.stroke()
|
||||||
ctx.closePath()
|
ctx.closePath()
|
||||||
|
|||||||
Reference in New Issue
Block a user