matterbridge
Version:
Matterbridge plugin manager for Matter
243 lines • 14.5 kB
TypeScript
/**
* This file contains the LaundryWasher class.
*
* @file laundryWasher.ts
* @author Luca Liguori
* @date 2025-05-25
* @version 1.1.0
*
* Copyright 2025, 2026, 2027 Luca Liguori.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. *
*/
import { MaybePromise } from '@matter/main';
import { OperationalState } from '@matter/main/clusters/operational-state';
import { LaundryWasherControls } from '@matter/main/clusters/laundry-washer-controls';
import { LaundryWasherMode } from '@matter/main/clusters/laundry-washer-mode';
import { TemperatureControl } from '@matter/main/clusters/temperature-control';
import { ModeBase } from '@matter/main/clusters/mode-base';
import { TemperatureControlServer } from '@matter/main/behaviors/temperature-control';
import { LaundryWasherModeServer } from '@matter/main/behaviors/laundry-washer-mode';
import { MatterbridgeEndpoint } from './matterbridgeEndpoint.js';
export declare class LaundryWasher extends MatterbridgeEndpoint {
/**
* Creates an instance of the LaundryWasher class.
*
* @param {string} name - The name of the laundry washer.
* @param {string} serial - The serial number of the laundry washer.
* @param {number} [currentMode=2] - The current mode of the laundry washer. Defaults to 2 (Normal mode). Dead Front OnOff Cluster will set this to 2 when turned off. Persistent attribute.
* @param {LaundryWasherMode.ModeOption[]} [supportedModes] - The supported modes of the laundry washer. Defaults to a set of common modes (which include Delicate, Normal, Heavy, and Whites). Fixed attribute.
* @param {number} [spinSpeedCurrent=2] - The current spin speed as index of the spinSpeeds array. Defaults to 2 (which corresponds to '1200').
* @param {string[]} [spinSpeeds] - The supported spin speeds. Defaults to ['400', '800', '1200', '1600'].
* @param {LaundryWasherControls.NumberOfRinses} [numberOfRinses=LaundryWasherControls.NumberOfRinses.Normal] - The number of rinses. Defaults to LaundryWasherControls.NumberOfRinses.Normal (which corresponds to 1 rinse).
* @param {LaundryWasherControls.NumberOfRinses[]} [supportedRinses] - The supported rinses. Defaults to [NumberOfRinses.None, NumberOfRinses.Normal, NumberOfRinses.Max, NumberOfRinses.Extra].
* @param {number} [selectedTemperatureLevel=1] - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 1 (which corresponds to 'Warm').
* @param {string[]} [supportedTemperatureLevels] - The supported temperature levels. Defaults to ['Cold', 'Warm', 'Hot', '30°', '40°', '60°', '80°']. Fixed attribute.
* @param {number} [temperatureSetpoint] - The temperature setpoint * 100. Defaults to 40 * 100 (which corresponds to 40°C).
* @param {number} [minTemperature=30 * 100] - The minimum temperature * 100. Defaults to 30 * 100 (which corresponds to 30°C). Fixed attribute.
* @param {number} [maxTemperature=60 * 100] - The maximum temperature * 100. Defaults to 60 * 100 (which corresponds to 60°C). Fixed attribute.
* @param {number} [step=10 * 100] - The step size for temperature changes. Defaults to 10 * 100 (which corresponds to 10°C). Fixed attribute.
* @param {OperationalState.OperationalStateEnum} [operationalState=OperationalState.OperationalStateEnum.Off] - The operational state of the laundry washer. Defaults to OperationalState.OperationalStateEnum.Off.
*
* @remarks
* - If `temperatureSetpoint` is provided, the `createNumberTemperatureControlClusterServer` method will be used to create the TemperatureControl Cluster Server with features TemperatureNumber and TemperatureStep.
* - If `temperatureSetpoint` is not provided, the `createLevelTemperatureControlClusterServer` method will be used to create the TemperatureControl Cluster Server with feature TemperatureLevel.
*
*/
constructor(name: string, serial: string, currentMode?: number, supportedModes?: LaundryWasherMode.ModeOption[], spinSpeedCurrent?: number, spinSpeeds?: string[], numberOfRinses?: LaundryWasherControls.NumberOfRinses, supportedRinses?: LaundryWasherControls.NumberOfRinses[], selectedTemperatureLevel?: number, supportedTemperatureLevels?: string[], temperatureSetpoint?: number, minTemperature?: number, maxTemperature?: number, step?: number, operationalState?: OperationalState.OperationalStateEnum);
/**
* Creates a default Laundry Washer Mode Cluster Server.
*
* @param {number} currentMode - The current mode of the laundry washer. Defaults to 2 (Normal mode). Dead Front OnOff Cluster will set this to 2 when turned off. Persistent attribute.
* @param {LaundryWasherMode.ModeOption[]} supportedModes - The supported modes of the laundry washer. Defaults to a set of common modes (which include Delicate, Normal, Heavy, and Whites). Fixed attribute.
*
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
*/
createDefaultLaundryWasherModeClusterServer(currentMode?: number, supportedModes?: LaundryWasherMode.ModeOption[]): this;
/**
* Creates a Laundry Washer Controls Cluster Server with feature Spin for selecting the spin speed and feature Rinse for selecting the number of rinses.
*
* @param {number} spinSpeedCurrent - The current spin speed as index of the spinSpeeds array. Default to 2 (which corresponds to '1200').
* @param {string[]} spinSpeeds - The supported spin speeds. Default to ['400', '800', '1200', '1600'].
* @param {LaundryWasherControls.NumberOfRinses} numberOfRinses - The number of rinses. Default to LaundryWasherControls.NumberOfRinses.Normal (which corresponds to 1 rinse).
* @param {LaundryWasherControls.NumberOfRinses[]} supportedRinses - The supported rinses. Default to [NumberOfRinses.None, NumberOfRinses.Normal, NumberOfRinses.Max, NumberOfRinses.Extra].
*
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
*/
createDefaultLaundryWasherControlsClusterServer(spinSpeedCurrent?: number, spinSpeeds?: string[], numberOfRinses?: LaundryWasherControls.NumberOfRinses, supportedRinses?: LaundryWasherControls.NumberOfRinses[]): this;
/**
* Creates a TemperatureControl Cluster Server with feature TemperatureLevel.
*
* @param {number} selectedTemperatureLevel - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 1 (which corresponds to 'Warm').
* @param {string[]} supportedTemperatureLevels - The supported temperature levels. Defaults to ['Cold', 'Warm', 'Hot', '30°', '40°', '60°', '80°']. Fixed attribute.
*
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
*/
createLevelTemperatureControlClusterServer(selectedTemperatureLevel?: number, supportedTemperatureLevels?: string[]): this;
/**
* Creates a TemperatureControl Cluster Server with features TemperatureNumber and TemperatureStep.
*
* @param {number} temperatureSetpoint - The temperature setpoint * 100. Defaults to 40 * 100 (which corresponds to 40°C).
* @param {number} minTemperature - The minimum temperature * 100. Defaults to 30 * 100 (which corresponds to 30°C). Fixed attribute.
* @param {number} maxTemperature - The maximum temperature * 100. Defaults to 60 * 100 (which corresponds to 60°C). Fixed attribute.
* @param {number} [step=1] - The step size for temperature changes. Defaults to 10 * 100 (which corresponds to 10°C). Fixed attribute.
*
* @returns {this} The current MatterbridgeEndpoint instance for chaining.
*/
createNumberTemperatureControlClusterServer(temperatureSetpoint?: number, minTemperature?: number, maxTemperature?: number, step?: number): this;
}
declare const MatterbridgeLevelTemperatureControlServer_base: import("@matter/main").ClusterBehavior.Type<import("@matter/types").ClusterComposer.WithFeatures<import("@matter/types").ClusterType.Of<{
readonly id: 86;
readonly name: "TemperatureControl";
readonly revision: 1;
readonly features: {
readonly temperatureNumber: import("@matter/types").BitFlag;
readonly temperatureLevel: import("@matter/types").BitFlag;
readonly temperatureStep: import("@matter/types").BitFlag;
};
readonly commands: {
readonly setTemperature: import("@matter/types").Command<import("@matter/types").TypeFromFields<{
targetTemperature: import("@matter/types").OptionalFieldType<number>;
targetTemperatureLevel: import("@matter/types").OptionalFieldType<number>;
}>, void, any>;
};
readonly extensions: readonly [{
readonly flags: {
readonly temperatureNumber: true;
};
readonly component: {
readonly attributes: {
readonly temperatureSetpoint: import("@matter/types").Attribute<number, any>;
readonly minTemperature: import("@matter/types").FixedAttribute<number, any>;
readonly maxTemperature: import("@matter/types").FixedAttribute<number, any>;
};
};
}, {
readonly flags: {
readonly temperatureStep: true;
};
readonly component: {
readonly attributes: {
readonly step: import("@matter/types").FixedAttribute<number, any>;
};
};
}, {
readonly flags: {
readonly temperatureLevel: true;
};
readonly component: {
readonly attributes: {
readonly selectedTemperatureLevel: import("@matter/types").Attribute<number, any>;
readonly supportedTemperatureLevels: import("@matter/types").Attribute<string[], any>;
};
};
}, {
readonly flags: {
readonly temperatureStep: true;
readonly temperatureNumber: false;
};
readonly component: false;
}, {
readonly flags: {
readonly temperatureNumber: true;
readonly temperatureLevel: true;
};
readonly component: false;
}, {
readonly flags: {
readonly temperatureNumber: false;
readonly temperatureLevel: false;
};
readonly component: false;
}];
}>, readonly [TemperatureControl.Feature.TemperatureLevel]>, typeof TemperatureControlServer, import("@matter/main/behaviors/temperature-control").TemperatureControlInterface>;
export declare class MatterbridgeLevelTemperatureControlServer extends MatterbridgeLevelTemperatureControlServer_base {
initialize(): void;
setTemperature(request: TemperatureControl.SetTemperatureRequest): MaybePromise;
}
declare const MatterbridgeNumberTemperatureControlServer_base: import("@matter/main").ClusterBehavior.Type<import("@matter/types").ClusterComposer.WithFeatures<import("@matter/types").ClusterType.Of<{
readonly id: 86;
readonly name: "TemperatureControl";
readonly revision: 1;
readonly features: {
readonly temperatureNumber: import("@matter/types").BitFlag;
readonly temperatureLevel: import("@matter/types").BitFlag;
readonly temperatureStep: import("@matter/types").BitFlag;
};
readonly commands: {
readonly setTemperature: import("@matter/types").Command<import("@matter/types").TypeFromFields<{
targetTemperature: import("@matter/types").OptionalFieldType<number>;
targetTemperatureLevel: import("@matter/types").OptionalFieldType<number>;
}>, void, any>;
};
readonly extensions: readonly [{
readonly flags: {
readonly temperatureNumber: true;
};
readonly component: {
readonly attributes: {
readonly temperatureSetpoint: import("@matter/types").Attribute<number, any>;
readonly minTemperature: import("@matter/types").FixedAttribute<number, any>;
readonly maxTemperature: import("@matter/types").FixedAttribute<number, any>;
};
};
}, {
readonly flags: {
readonly temperatureStep: true;
};
readonly component: {
readonly attributes: {
readonly step: import("@matter/types").FixedAttribute<number, any>;
};
};
}, {
readonly flags: {
readonly temperatureLevel: true;
};
readonly component: {
readonly attributes: {
readonly selectedTemperatureLevel: import("@matter/types").Attribute<number, any>;
readonly supportedTemperatureLevels: import("@matter/types").Attribute<string[], any>;
};
};
}, {
readonly flags: {
readonly temperatureStep: true;
readonly temperatureNumber: false;
};
readonly component: false;
}, {
readonly flags: {
readonly temperatureNumber: true;
readonly temperatureLevel: true;
};
readonly component: false;
}, {
readonly flags: {
readonly temperatureNumber: false;
readonly temperatureLevel: false;
};
readonly component: false;
}];
}>, readonly [TemperatureControl.Feature.TemperatureNumber, TemperatureControl.Feature.TemperatureStep]>, typeof TemperatureControlServer, import("@matter/main/behaviors/temperature-control").TemperatureControlInterface>;
export declare class MatterbridgeNumberTemperatureControlServer extends MatterbridgeNumberTemperatureControlServer_base {
initialize(): void;
setTemperature(request: TemperatureControl.SetTemperatureRequest): MaybePromise;
}
export declare class MatterbridgeLaundryWasherModeServer extends LaundryWasherModeServer {
initialize(): void;
protected handleOnOffChange(onOff: boolean): void;
changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>;
}
export {};
//# sourceMappingURL=laundryWasher.d.ts.map