端点 UI rules
The endpoint UI rules object represents the user interface rules applied to a device, typically used in 设备模型配置 scripts.
The update端点UIRules function receives an object of this type as a parameter, which allows establishing the user interface rules for the endpoint given as a parameter in the script.
属性
canDelete (boolean) The canDelete property indicates whether it is possible to delete the endpoint given as a parameter. The value true indicates that deleting the endpoint is allowed, while the value false prevents its deletion.
示例
此示例 allows deleting any endpoint, except if its address is "1".
function updateEndpointUIRules(endpoint, rules)
{
rules.canDelete = (endpoint.address != "1");
}canEditSubType (boolean) The canEditSubType property indicates whether it is possible to change the endpoint subtype, corresponding to the endpointSubType property. The value true indicates that editing the subtype is allowed, while the value false prevents it.
示例
此示例 allows modifying the subtype of any endpoint, but only if it is of appliance type.
function updateEndpointUIRules(endpoint, rules)
{
rules.canEditSubType = (endpoint.endpointType == endpointType.appliance);
}canEditAccessType (boolean) The canEditAccessType property indicates whether it is possible to edit the accessType property of the endpoint. The value true indicates that editing is allowed, while the value false prevents it. The default value for this property is false. 更多信息 about the accessType property, see this section.
示例
此示例 allows modifying the accessType property of any endpoint.
function updateEndpointUIRules(endpoint, rules)
{
rules.canEditAccessType = true;
}canEditOperation安全Level (boolean) The canEditOperation安全Level property indicates whether it is possible to edit the operation安全Level property of the endpoint. The value true indicates that editing is allowed, while the value false prevents it. The default value for this property is false. 更多信息 about the operation安全Level property, see this section.
示例
此示例 allows modifying the operation安全Level property of any endpoint.
function updateEndpointUIRules(endpoint, rules)
{
rules.canEditOperationSecurityLevel = true;
}canEditRange (boolean) The canEditRange property indicates whether it is possible to edit the range property of the endpoint. The value true indicates that editing is allowed, while the value false prevents it. The default value for this property is false. 更多信息 about the range property, see this section.
示例
此示例 allows modifying the range property of any endpoint.
function updateEndpointUIRules(endpoint, rules)
{
rules.canEditRange = false;
}canEditSummationAutoReset (boolean) The canEditSummationAutoReset property indicates whether it is possible to change the value of the summationAutoResetThreshold property. The value true indicates that editing is allowed, while the value false prevents it.
示例
此示例 allows modifying the "summation auto reset" property of any endpoint, but only if it is of energy meter type.
function updateEndpointUIRules(endpoint, rules)
{
rules.canEditSummationAutoReset = (endpoint.endpointType == endpointType.energyMeter);
}canEditElectricalCircuit (boolean) The canEditElectricalCircuit property indicates whether it is possible to edit the electrical circuit associated with the endpoint. The value true indicates that editing is allowed, while the value false prevents it.
示例
此示例 allows modifying the electrical circuit of any endpoint, but only if it is of energy meter type.
function updateEndpointUIRules(endpoint, rules)
{
rules.canEditElectricalCircuit = (endpoint.endpointType == endpointType.energyMeter);
}