Readonly
eventsAccess the behavior's events.
Optional
Readonly
valveThis event shall be generated when the valve registers or clears a fault, e.g. not being able to transition to the requested target level or state.
Optional
Readonly
valveThis event shall be generated when the valve state changed. For level changes, after the end of movement, for state changes when the new state has been reached.
Supported features as a flag object.
Readonly
stateAccess the behavior's state.
Readonly
currentIndicates the current state of the valve.
A value of null shall indicate that the current state is not known.
Readonly
defaultIndicates the default duration, in seconds, for which the valve will remain open, if the OpenDuration field is not present in the Open command.
A value of null shall indicate the duration is not set, meaning that the valve will remain open until closed by the user or some other automation.
Readonly
openIndicates the total duration, in seconds, for which the valve will remain open for this current opening.
A value of null shall indicate the duration is not set, meaning that the valve will remain open until closed by the user or some other automation.
Readonly
remainingIndicates the remaining duration, in seconds, until the valve closes. Null:
• When OpenDuration is null, or
• When the valve is closed.
The value of this attribute shall only be reported in the following cases:
• When it changes from null to any other value and vice versa, or
• When it changes to 0, or
• When it increases, or
• When the closing time changes.
Meaning that clients SHOULD NOT rely on the reporting of this attribute in order to keep track of the remaining duration, due to this attribute not being reported during regular countdown.
When reading this attribute it shall return the remaining duration, in seconds, until the valve closes.
When the value of this attribute counts down to 0, the valve shall automatically transition to its closed position. The behavior of transitioning to the closed position shall match the behavior described in the Close command.
Readonly
targetIndicates the target state, while changing the state, of the valve.
A value of null shall indicate that no target position is set, since the change in state is either done or failed.
Release resources. This is the public API for releasing application resources held by behaviors in internal state.
Execute logic with elevated privileges.
The provided function executes with privileges escalated to offline mode. This is not commonly necessary.
Elevated logic effectively ignores ACLs so should be used with care.
Note that interactions with the behavior will remain elevated until the synchronous completion of this call. You should only elevate privileges for synchronous logic.
the elevated logic
Protected
callbackCreate a generic callback function that has the same properties as a Reactor.
Like a reactor, the callback's "this" will be bound to an active Behavior instance. Because of this: The reactor MUST be a real JS function - arrow functions will not work!
This command is used to set the valve to its closed position.
Behaviors are ephemeral and should not perform initialization in their constructor. They can override this method instead.
This method may be synchronous or asyncronous. If asynchronous, the behavior will not be available for external use until initialization completes.
Optional
_options: {}This command is used to set the valve to its open position.
Protected
reactInstall a Reactor.
Important: The reactor MUST be a real JS function - arrow functions will not work!
The implemented cluster.