Endpoint UI rules
The endpoint UI rules object represents the user interface rules applied to a device, typically used in device model configuration scripts.
The updateEndpointUIRules 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.
Properties
### 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.
Examples
This example 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.
Examples
This example 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. For more information about the accessType property, see this section.
Examples
This example allows modifying the accessType property of any endpoint.
function updateEndpointUIRules(endpoint, rules)
{
rules.canEditAccessType = true;
}### canEditOperationSecurityLevel (boolean) The canEditOperationSecurityLevel property indicates whether it is possible to edit the operationSecurityLevel 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. For more information about the operationSecurityLevel property, see this section.
Examples
This example allows modifying the operationSecurityLevel 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. For more information about the range property, see this section.
Examples
This example 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.
Examples
This example 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.
Examples
This example 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);
}