Merge PR #217: Support the upcoming powerswitch interface

This commit is contained in:
Jenkins 2019-07-05 01:25:33 +02:00
commit d8ffaff23d
2 changed files with 5 additions and 1 deletions

View File

@ -145,7 +145,7 @@ QString DeviceClass::baseInterface() const
if (m_interfaces.contains("media")) {
return "media";
}
if (m_interfaces.contains("button")) {
if (m_interfaces.contains("button") || m_interfaces.contains("powerswitch")) {
return "button";
}
if (m_interfaces.contains("notifications")) {

View File

@ -81,6 +81,7 @@ ApplicationWindow {
case "media":
return qsTr("Media")
case "button":
case "powerswitch":
return qsTr("Switches")
case "gateway":
return qsTr("Gateways")
@ -182,6 +183,7 @@ ApplicationWindow {
case "longpressbutton":
case "simplemultibutton":
case "longpressmultibutton":
case "powerswitch":
return Qt.resolvedUrl("images/system-shutdown.svg")
case "weather":
return Qt.resolvedUrl("images/weather-app-symbolic.svg")
@ -298,6 +300,8 @@ ApplicationWindow {
page = "MediaDevicePage.qml";
} else if (interfaceList.indexOf("button") >= 0) {
page = "ButtonDevicePage.qml";
} else if (interfaceList.indexOf("powerswitch") >= 0) {
page = "ButtonDevicePage.qml";
} else if (interfaceList.indexOf("weather") >= 0) {
page = "WeatherDevicePage.qml";
} else if (interfaceList.indexOf("heating") >= 0 || interfaceList.indexOf("thermostat") >= 0) {