Small fixes
This commit is contained in:
parent
629290767f
commit
13f4bcc414
@ -39,6 +39,7 @@
|
||||
"interfaceName": "moisturesensor",
|
||||
"interfaceState": "moisture",
|
||||
"operator": "ValueOperatorLess",
|
||||
"selectionMode": "SelectionModeDevice",
|
||||
"selectionId": 0,
|
||||
"value": 20
|
||||
}
|
||||
|
||||
@ -286,39 +286,57 @@ ApplicationWindow {
|
||||
case "dimmablelight":
|
||||
case "colorlight":
|
||||
case "colortemperaturelight":
|
||||
//: Select ...
|
||||
return qsTr("light")
|
||||
case "button":
|
||||
return "button";
|
||||
case "sensor":
|
||||
//: Select ...
|
||||
return qsTr("sensor")
|
||||
case "battery":
|
||||
//: Select ...
|
||||
return qsTr("battery powered thing")
|
||||
case "connectable":
|
||||
//: Select ...
|
||||
return qsTr("connectable thing")
|
||||
case "power":
|
||||
//: Select ...
|
||||
return qsTr("switchable thing")
|
||||
case "daylightsensor":
|
||||
//: Select ...
|
||||
return qsTr("daylight sensor")
|
||||
case "presencesensor":
|
||||
//: Select ...
|
||||
return qsTr("presence sensor")
|
||||
case "doorbell":
|
||||
//: Select ...
|
||||
return qsTr("doorbell")
|
||||
case "alert":
|
||||
//: Select ...
|
||||
return qsTr("alert")
|
||||
case "simplemultibutton":
|
||||
case "simplebutton":
|
||||
case "button":
|
||||
//: Select ...
|
||||
return qsTr("button")
|
||||
case "accesscotrol":
|
||||
//: Select ...
|
||||
return qsTr("access control")
|
||||
case "smartmeter":
|
||||
case "smartmeterproducer":
|
||||
case "smartmeterconsumer":
|
||||
case "extendedsmartmeterproducer":
|
||||
case "extendedsmartmeterconsumer":
|
||||
//: Select ...
|
||||
return qsTr("smart meter");
|
||||
case "media":
|
||||
case "mediaplayer":
|
||||
return qsTr("media player")
|
||||
//: Select ...
|
||||
return qsTr("media player");
|
||||
case "moisturesensor":
|
||||
//: Select ...
|
||||
return qsTr("moisture sensor");
|
||||
case "notifications":
|
||||
//: Select ...
|
||||
return qsTr("thing to notify")
|
||||
default:
|
||||
console.warn("Unhandled interfaceToDisplayName:", name)
|
||||
}
|
||||
|
||||
@ -196,7 +196,8 @@ Page {
|
||||
rule.name = ruleTemplate.ruleNameTemplate;
|
||||
for (var selectionId in selectedThingNames) {
|
||||
print("Replacing", selectionId, "with", selectedThingNames[selectionId], selectedInterfaces[selectionId])
|
||||
rule.name = rule.name.replace("%" + selectionId, selectedThingNames[selectionId])
|
||||
var thingName = selectedThingNames[selectionId];
|
||||
rule.name = rule.name.replace("%" + selectionId, thingName)
|
||||
|
||||
for (var j = 0; j < rule.actions.count; j++) {
|
||||
var action = rule.actions.get(j);
|
||||
@ -204,7 +205,7 @@ Page {
|
||||
var actionParam = action.ruleActionParams.get(k);
|
||||
print("replacing args", typeof actionParam.value)
|
||||
if (typeof actionParam.value === "string") {
|
||||
actionParam.value = actionParam.value.replace("%" + selectionId, device.name);
|
||||
actionParam.value = actionParam.value.replace("%" + selectionId, thingName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -213,7 +214,7 @@ Page {
|
||||
for(var k = 0; k < action.ruleActionParams.count; k++) {
|
||||
var actionParam = action.ruleActionParams.get(k);
|
||||
if (typeof actionParam.value === "string") {
|
||||
actionParam.value = actionParam.value.replace("%" + selectionId, device.name);
|
||||
actionParam.value = actionParam.value.replace("%" + selectionId, thingName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,8 +24,8 @@ Page {
|
||||
|
||||
header: NymeaHeader {
|
||||
text: root.selectInterface ?
|
||||
qsTr("Select a kind of things") :
|
||||
root.shownInterfaces.length > 0 ? qsTr("Select a %1").arg(app.interfaceToDisplayName(root.shownInterfaces[0])) : qsTr("Select a thing")
|
||||
qsTr("Select kind of things") :
|
||||
root.shownInterfaces.length > 0 ? qsTr("Select %1").arg(app.interfaceToDisplayName(root.shownInterfaces[0])) : qsTr("Select thing")
|
||||
onBackPressed: root.backPressed()
|
||||
|
||||
HeaderButton {
|
||||
|
||||
Reference in New Issue
Block a user