Fix erraneously displayed powet switch in generic list page

This commit is contained in:
Michael Zanetti 2020-12-20 14:19:42 +01:00
parent eea91a2d7f
commit 6445d2dc59
2 changed files with 1 additions and 15 deletions

View File

@ -107,20 +107,6 @@ DeviceListPageBase {
ThingStatusIcons {
thing: itemDelegate.thing
}
Switch {
visible: itemDelegate.powerState !== null
checked: itemDelegate.powerState && itemDelegate.powerState.value === true
enabled: itemDelegate.isEnabled
onClicked: {
var params = [];
var param1 = {};
param1["paramTypeId"] = itemDelegate.powerState.stateTypeId;
param1["value"] = checked;
params.push(param1)
engine.deviceManager.executeAction(itemDelegate.thing.id, itemDelegate.powerState.stateTypeId, params)
}
}
}
}
}

View File

@ -44,7 +44,7 @@ DevicePageBase {
title: qsTr("This switch has not been used yet.")
text: qsTr("Press a button on the switch to see logs appearing here.")
visible: logView.logsModel.count === 0
visible: !logsModel.busy && logsModel.count === 0
buttonVisible: false
imageSource: "../images/system-shutdown.svg"
}