Merge PR #217: Support the upcoming powerswitch interface
This commit is contained in:
commit
d8ffaff23d
@ -145,7 +145,7 @@ QString DeviceClass::baseInterface() const
|
|||||||
if (m_interfaces.contains("media")) {
|
if (m_interfaces.contains("media")) {
|
||||||
return "media";
|
return "media";
|
||||||
}
|
}
|
||||||
if (m_interfaces.contains("button")) {
|
if (m_interfaces.contains("button") || m_interfaces.contains("powerswitch")) {
|
||||||
return "button";
|
return "button";
|
||||||
}
|
}
|
||||||
if (m_interfaces.contains("notifications")) {
|
if (m_interfaces.contains("notifications")) {
|
||||||
|
|||||||
@ -81,6 +81,7 @@ ApplicationWindow {
|
|||||||
case "media":
|
case "media":
|
||||||
return qsTr("Media")
|
return qsTr("Media")
|
||||||
case "button":
|
case "button":
|
||||||
|
case "powerswitch":
|
||||||
return qsTr("Switches")
|
return qsTr("Switches")
|
||||||
case "gateway":
|
case "gateway":
|
||||||
return qsTr("Gateways")
|
return qsTr("Gateways")
|
||||||
@ -182,6 +183,7 @@ ApplicationWindow {
|
|||||||
case "longpressbutton":
|
case "longpressbutton":
|
||||||
case "simplemultibutton":
|
case "simplemultibutton":
|
||||||
case "longpressmultibutton":
|
case "longpressmultibutton":
|
||||||
|
case "powerswitch":
|
||||||
return Qt.resolvedUrl("images/system-shutdown.svg")
|
return Qt.resolvedUrl("images/system-shutdown.svg")
|
||||||
case "weather":
|
case "weather":
|
||||||
return Qt.resolvedUrl("images/weather-app-symbolic.svg")
|
return Qt.resolvedUrl("images/weather-app-symbolic.svg")
|
||||||
@ -298,6 +300,8 @@ ApplicationWindow {
|
|||||||
page = "MediaDevicePage.qml";
|
page = "MediaDevicePage.qml";
|
||||||
} else if (interfaceList.indexOf("button") >= 0) {
|
} else if (interfaceList.indexOf("button") >= 0) {
|
||||||
page = "ButtonDevicePage.qml";
|
page = "ButtonDevicePage.qml";
|
||||||
|
} else if (interfaceList.indexOf("powerswitch") >= 0) {
|
||||||
|
page = "ButtonDevicePage.qml";
|
||||||
} else if (interfaceList.indexOf("weather") >= 0) {
|
} else if (interfaceList.indexOf("weather") >= 0) {
|
||||||
page = "WeatherDevicePage.qml";
|
page = "WeatherDevicePage.qml";
|
||||||
} else if (interfaceList.indexOf("heating") >= 0 || interfaceList.indexOf("thermostat") >= 0) {
|
} else if (interfaceList.indexOf("heating") >= 0 || interfaceList.indexOf("thermostat") >= 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user