Optional
getter: ((session?: Session, endpoint?: EndpointInterface, isFabricFiltered?: boolean, message?: Message) => T)Optional
session: SessionOptional
endpoint: EndpointInterfaceOptional
isFabricFiltered: booleanOptional
message: MessageOptional
setter: ((value: T, session?: Session, endpoint?: EndpointInterface, message?: Message) => boolean)Optional setter function to handle special requirements or the data are stored in different places. If a setter method is used for a writable attribute, the getter method must be implemented as well. The method needs to return if the stored value has changed or not.
the value to be set.
Optional
session: Sessionthe session that is requesting the value (if any).
Optional
endpoint: EndpointInterfacethe endpoint the cluster server of this attribute is assigned to.
Optional
message: Messagetrue if the value has changed, false otherwise.
Optional
validator: ((value: T, session?: Session, endpoint?: EndpointInterface) => void)Optional Validator function to handle special requirements for verification of stored data. The method should throw an error if the value is not valid. If a StatusResponseError is thrown this one is also returned to the client.
If a setter is used then no validator should be used as the setter should handle the validation itself!
the value to be set.
Optional
session: Sessionthe session that is requesting the value (if any).
Optional
endpoint: EndpointInterfacethe endpoint the cluster server of this attribute is assigned to.
Protected
Readonly
datasourceReadonly
defaultProtected
Optional
delayedProtected
Optional
endpointProtected
Readonly
getterReadonly
idReadonly
isReadonly
isReadonly
isReadonly
nameReadonly
requiresReadonly
schemaProtected
Readonly
setterProtected
Readonly
validatorProtected
valueThe value is undefined when getter/setter are used. But we still handle the version number here.
Protected
Readonly
valueProtected
Readonly
valueGet the value of the attribute. This method is used by the Interaction model to read the value of the attribute and includes the ACL check. It should not be used locally in the code!
If a getter is defined the value is determined by that getter method.
Get the value of the attribute including the version number. This method is used by the Interaction model to read the value of the attribute and includes the ACL check. It should not be used locally in the code!
If a getter is defined the value is determined by that getter method. The version number is always 0 for fixed attributes.
Protected
handleInitialize the value of the attribute, used when a persisted value is set initially or when values needs to be adjusted before the Device gets announced. Do not use this method to change values when the device is in use!
Protected
processSet the value of the attribute. This method is used by the Interaction model to write the value of the attribute and includes the ACL check. It should not be used locally in the code!
If a setter is defined this setter method is called to store the value.
Listeners are called when the value changes (internal listeners) or in any case (external listeners).
Set the value of the attribute locally. This method should be used locally in the code and does not include the ACL check.
If a setter is defined this setter method is called to validate and store the value.
Else if a validator is defined the value is validated before it is stored.
Listeners are called when the value changes (internal listeners) or in any case (external listeners).
Protected
setWhen the value is handled by getter or setter methods and is changed by other processes this method can be used to notify the attribute server that the value has changed. This will increase the version number and trigger the listeners.
ACL checks needs to be performed before calling this method.
When the value is handled by getter or setter methods and is changed by other processes and no session from the originating process is known this method can be used to notify the attribute server that the value has changed. This will increase the version number and trigger the listeners.
ACL checks needs to be performed before calling this method.
Attribute server for normal attributes that can be read and written.