The implemented cluster.
Access the behavior's events.
Supported features as a flag object.
ProtectedinternalAccess the behavior's state.
Static ReadonlyclusterBase cluster state include all attribute values but may be extended by subclasses.
Static ReadonlydefaultsStatic Optional ReadonlydependenciesStatic ReadonlyearlyStatic ReadonlyExtensionStatic ReadonlyidThe behavior ID for ClusterBehaviors is the name of the cluster.
Static ReadonlyInterfaceStatic ReadonlynameStatic Optional ReadonlyschemaStatic ReadonlysupervisorStaticsupportsDoes this behavior support functionality of a specific implementation?
ProtectedcallbackCreate 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!
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.
ProtectedreactInstall a Reactor.
Important: The reactor MUST be a real JS function - arrow functions will not work!
StaticalterStaticenableStaticforStaticsetStaticwith
This is the default server implementation of SwitchBehavior.
This implementation includes all features of WindowCovering.Cluster and implements all mandatory commands. You should use WindowCoveringServer.with to specialize the class for the features your implementation supports.
To support all features and events the implementation adds some custom state attributes that can - or are required to - be used. These are:
rawPosition- The raw position of the switch. This is the position as reported by the device and is not yet debounced. If the position is already debounced, just set thecurrentPositionattribute. The debouncing uses thedebounceDelayattribute value as timeframe in milliseconds and sets thecurrentPositionattribute when the value is stable for this timeframe.debounceDelay- The timeframe in milliseconds to wait until a newly reported position is considered stable.longPressDelay- The timeframe in milliseconds to wait until a position is considered "long" pressed. This attribute is REQUIRED if the device supports the Momentary Switch LongPress (MSL) feature.multiPressDelay- The timeframe in milliseconds starting with a stable release to detect multi-presses. This attribute is REQUIRED if the device supports the Momentary Switch MultiPress (MSM) feature.momentaryNeutralPosition- The number of the position considered as the neutral position for the momentary switch. This defaults to position 0 but can be changed by settings this attribute. it is available as soon as the Momentary Switch (MS) feature is used.