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.

29 lines
833 B
QML

import QtQuick 2.5
import QtQuick.Controls 2.1
import QtQuick.Controls.Material 2.1
import QtQuick.Layouts 1.3
import "../components"
import Nymea 1.0
CustomViewBase {
id: root
implicitHeight: width * .6
property string interfaceName
readonly property string stateTypeName: {
switch (interfaceName) {
case "lightsensor":
return "lightIntensity";
default:
return interfaceName.replace("sensor", "");
}
}
GenericTypeGraph {
anchors { left: parent.left; top: parent.top; right: parent.right; bottom: parent.bottom }
device: root.device
stateType: root.deviceClass.stateTypes.findByName(root.stateTypeName)
color: app.interfaceToColor(root.interfaceName)
iconSource: app.interfaceToIcon(root.interfaceName)
}
}