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