interface FanControlBehavior {
    [reference]: Datasource<StateType>;
    agent: Agent;
    cluster: never;
    context: ActionContext;
    endpoint: Endpoint<Empty>;
    env: Environment;
    events: EventEmitter & Omit<ClusterEvents<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {
        fanMode$Changing: ClusterEvents.AttributeObservable<WritableAttribute<FanControl.FanMode, any>>;
        fanModeSequence$Changing: ClusterEvents.AttributeObservable<FixedAttribute<FanControl.FanModeSequence, any>>;
        percentCurrent$Changing: ClusterEvents.AttributeObservable<Attribute<number, any>>;
        percentSetting$Changing: ClusterEvents.AttributeObservable<WritableAttribute<null | number, any>>;
    } & {} & {
        fanMode$Changed: ClusterEvents.AttributeObservable<WritableAttribute<FanControl.FanMode, any>>;
        fanModeSequence$Changed: ClusterEvents.AttributeObservable<FixedAttribute<FanControl.FanModeSequence, any>>;
        percentCurrent$Changed: ClusterEvents.AttributeObservable<Attribute<number, any>>;
        percentSetting$Changed: ClusterEvents.AttributeObservable<WritableAttribute<null | number, any>>;
    } & {} & {} & {};
    features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
        airflowDirection: BitFlag;
        auto: BitFlag;
        multiSpeed: BitFlag;
        rocking: BitFlag;
        step: BitFlag;
        wind: BitFlag;
    }>;
    session: SecureSession;
    state: Omit<ClusterState.Type<Of<{
        attributes: {};
        commands: {};
        events: {};
        id: 0;
        name: "Unknown";
        revision: 0;
    }>, typeof ClusterBehavior>, never> & {
        fanMode: FanControl.FanMode;
        percentCurrent: number;
        percentSetting: null | number;
    } & {} & {
        fanModeSequence: FanControl.FanModeSequence;
    } & {};
    [asyncDispose](): MaybePromise;
    asAdmin(fn: (() => void)): void;
    assertAttributeEnabled<This, K>(this: This, attributeName: K): void;
    callback<A, R>(reactor: Reactor<A, R>, options?: Reactor.Options): ((...args: A) => undefined | R);
    initialize(_options?: {}): MaybePromise;
    reactTo<O>(observable: O, reactor: Reactor<Parameters<O["emit"]>, ReturnType<O["emit"]>>, options?: Reactor.Options): void;
    requireAttributeEnabled<This, K>(this: This, attributeName: K): Exclude<This["state"][K], undefined>;
    toString(): string;
    State: any;
}

Hierarchy (view full)

Properties

[reference]: Datasource<StateType>
agent: Agent
cluster: never

The implemented cluster.

context: ActionContext
endpoint: Endpoint<Empty>
events: EventEmitter & Omit<ClusterEvents<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior>, never> & {
    fanMode$Changing: ClusterEvents.AttributeObservable<WritableAttribute<FanControl.FanMode, any>>;
    fanModeSequence$Changing: ClusterEvents.AttributeObservable<FixedAttribute<FanControl.FanModeSequence, any>>;
    percentCurrent$Changing: ClusterEvents.AttributeObservable<Attribute<number, any>>;
    percentSetting$Changing: ClusterEvents.AttributeObservable<WritableAttribute<null | number, any>>;
} & {} & {
    fanMode$Changed: ClusterEvents.AttributeObservable<WritableAttribute<FanControl.FanMode, any>>;
    fanModeSequence$Changed: ClusterEvents.AttributeObservable<FixedAttribute<FanControl.FanModeSequence, any>>;
    percentCurrent$Changed: ClusterEvents.AttributeObservable<Attribute<number, any>>;
    percentSetting$Changed: ClusterEvents.AttributeObservable<WritableAttribute<null | number, any>>;
} & {} & {} & {}

Access the behavior's events.

features: TypeFromBitSchema<{}> & TypeFromBitSchema<{
    airflowDirection: BitFlag;
    auto: BitFlag;
    multiSpeed: BitFlag;
    rocking: BitFlag;
    step: BitFlag;
    wind: BitFlag;
}>

Supported features as a flag object.

session: SecureSession
state: Omit<ClusterState.Type<Of<{
    attributes: {};
    commands: {};
    events: {};
    id: 0;
    name: "Unknown";
    revision: 0;
}>, typeof ClusterBehavior>, never> & {
    fanMode: FanControl.FanMode;
    percentCurrent: number;
    percentSetting: null | number;
} & {} & {
    fanModeSequence: FanControl.FanModeSequence;
} & {}

Access the behavior's state.

Type declaration

  • ReadonlyfanMode: FanControl.FanMode

    Indicates the current speed mode of the fan. This attribute may be written by the client to request a different fan mode. A server shall return INVALID_IN_STATE to indicate that the fan is not in a state where the FanMode can be changed to the requested value. A server may have FanMode values that it can never be set to. For example, where this cluster appears on the same or another endpoint as other clusters with a system dependency, for example the Thermostat cluster, attempting to set the FanMode attribute of this cluster to Off may not be allowed by the system.

    This attribute shall be set to one of the values in FanModeEnum.

    When the FanMode attribute is successfully written to, the PercentSetting and SpeedSetting (if present) attributes shall be set to appropriate values, as defined by the Percent Rules and Speed Rules respectively, unless otherwise specified below.

    When the FanMode attribute is set to any given mode, the PercentCurrent and SpeedCurrent (if present) shall indicate the actual currently operating fan speed, unless otherwise specified below.

    MatterSpecification.v13.Cluster § 4.4.6.1

  • ReadonlypercentCurrent: number

    Indicates the actual currently operating fan speed, or zero to indicate that the fan is off. There may be a temporary mismatch between the value of this attribute and the value of the PercentSetting attribute due to other system requirements that would not allow the fan to operate at the requested setting. See Percent Rules for more details.

    MatterSpecification.v13.Cluster § 4.4.6.4

  • ReadonlypercentSetting: null | number

    Indicates the speed setting for the fan. This attribute may be written by the client to indicate a new fan speed. If the client writes null to this attribute, the attribute value shall NOT change. A server shall return INVALID_IN_STATE to indicate that the fan is not in a state where the PercentSetting can be changed to the requested value.

    If this is successfully written to 0, the server shall set the FanMode attribute value to Off.

    MatterSpecification.v13.Cluster § 4.4.6.3

Type declaration

  • ReadonlyfanModeSequence: FanControl.FanModeSequence

    This attribute indicates the fan speed ranges that shall be supported.

    MatterSpecification.v13.Cluster § 4.4.6.2

Methods

  • Create 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!

    Type Parameters

    • A extends any[]
    • R

    Parameters

    Returns ((...args: A) => undefined | R)

      • (...args): undefined | R
      • Parameters

        • Rest...args: A

        Returns undefined | R

  • 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.

    Parameters

    • Optional_options: {}

      Returns MaybePromise

    • Install a Reactor.

      Important: The reactor MUST be a real JS function - arrow functions will not work!

      Type Parameters

      Parameters

      Returns void