Update gas interface

pull/894/head
Michael Zanetti 2022-10-03 01:37:35 +02:00
parent e66a1cd3cc
commit f7b392cc04
4 changed files with 9 additions and 6 deletions

View File

@ -321,7 +321,7 @@ MainPageTile {
ListElement { ifaceName: "firesensor"; stateName: "fireDetected" }
ListElement { ifaceName: "cosensor"; stateName: "co" }
ListElement { ifaceName: "co2sensor"; stateName: "co2" }
ListElement { ifaceName: "gassensor"; stateName: "gas" }
ListElement { ifaceName: "gassensor"; stateName: "gasLevel" }
ListElement { ifaceName: "conductivity"; stateName: "conductivity" }
ListElement { ifaceName: "noisesensor"; stateName: "noise" }
ListElement { ifaceName: "smartmeterconsumer"; stateName: "currentPower" }

View File

@ -239,7 +239,7 @@ MainPageTile {
tmp.push({iface: "co2sensor", state: "co2"});
}
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) {
tmp.push({iface: "smartmeterconsumer", state: "currentPower"});

View File

@ -82,7 +82,7 @@ ThingsListPageBase {
ListElement { interfaceName: "noisesensor"; stateName: "noise" }
ListElement { interfaceName: "cosensor"; stateName: "co" }
ListElement { interfaceName: "co2sensor"; stateName: "co2" }
ListElement { interfaceName: "gassensor"; stateName: "gas" }
ListElement { interfaceName: "gassensor"; stateName: "gasLevel" }
ListElement { interfaceName: "daylightsensor"; stateName: "daylight" }
ListElement { interfaceName: "presencesensor"; stateName: "isPresent" }
ListElement { interfaceName: "closablesensor"; stateName: "closed" }

View File

@ -48,7 +48,7 @@ ThingPageBase {
"noisesensor": "noise",
"cosensor": "co",
"co2sensor": "co2",
"gassensor": "gas",
"gassensor": "gasLevel",
"presencesensor": "isPresent",
"daylightsensor": "daylight",
"closablesensor": "closed",
@ -338,6 +338,10 @@ ThingPageBase {
property var minValue: parent.minValue
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 {
anchors.centerIn: parent
width: parent.width * 0.6
@ -372,8 +376,7 @@ ThingPageBase {
ctx.beginPath()
ctx.strokeStyle = app.interfaceToColor(progressCanvas.interfaceName)
var progress = (progressCanvas.state.value - progressCanvas.minValue) / (progressCanvas.maxValue - progressCanvas.minValue)
radEnd *= progress
radEnd *= progressCanvas.progress
ctx.arc(0, 0, width / 2 - ctx.lineWidth / 2, radStart, radEnd)
ctx.stroke()
ctx.closePath()