This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-app/guh-control/ui/devicepages/SensorDevicePage.qml
Michael Zanetti 93c91d71bd more work
2018-02-25 05:48:36 +01:00

32 lines
874 B
QML

import QtQuick 2.5
import QtQuick.Controls 2.1
import QtQuick.Layouts 1.1
import Guh 1.0
import "../components"
import "../customviews"
DevicePageBase {
id: root
ListView {
anchors { fill: parent }
spacing: app.margins
model: ListModel {
Component.onCompleted: {
var supportedInterfaces = ["temperaturesensor", "humiditysensor"]
for (var i = 0; i < supportedInterfaces.length; i++) {
if (root.deviceClass.interfaces.indexOf(supportedInterfaces[i]) >= 0) {
append({name: supportedInterfaces[i]});
}
}
}
}
delegate: SensorView {
width: parent.width
interfaceName: modelData
device: root.device
deviceClass: root.deviceClass
}
}
}