UNPKG

matterbridge

Version:
168 lines 8.27 kB
/** * @description This file contains the MicrowaveOven class. * @file src/devices/microwaveOven.ts * @author Luca Liguori * @created 2025-05-25 * @version 1.1.0 * @license Apache-2.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 { MicrowaveOvenMode } from '@matter/main/clusters/microwave-oven-mode'; import { MicrowaveOvenControl } from '@matter/main/clusters/microwave-oven-control'; import { MicrowaveOvenControlServer } from '@matter/main/behaviors/microwave-oven-control'; import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js'; export declare class MicrowaveOven extends MatterbridgeEndpoint { /** * Creates an instance of the MicrowaveOven class. * * @param {string} name - The name of the microwave oven. * @param {string} serial - The serial number of the microwave oven. * @param {number} currentMode - The current mode of the microwave oven. Default is 1 = Auto. * @param {MicrowaveOvenMode.ModeOption[]} supportedModes - The supported modes of the microwave oven. Default is an array of all modes. * @param {number} selectedWattIndex - The selected wattage index. Default is 5 (600W). * @param {number[]} supportedWatts - The supported wattages. Default is an array of all standard microwave wattages. * @param {number} cookTime - The initial cook time in seconds. Default is 60 seconds. * @param {number} maxCookTime - The maximum cook time in seconds. Default is 3600 seconds (1 hour). * * @remarks * - 8.12. Microwave Oven Mode Cluster * - Exactly one entry in the SupportedModes attribute SHALL include the Normal mode tag in the ModeTags field. * - The Normal and Defrost mode tags are mutually exclusive and SHALL NOT both be used together in a mode’s ModeTags. */ constructor(name: string, serial: string, currentMode?: number, supportedModes?: MicrowaveOvenMode.ModeOption[], selectedWattIndex?: number, supportedWatts?: number[], cookTime?: number, // 1 minute maxCookTime?: number); /** * Creates a default MicrowaveOvenMode Cluster Server. * There is no changeToMode command in the spec, so this is not implemented. * The Microwave is controlled by the MicrowaveOvenControl cluster. * * @param {number} currentMode - The current mode of the oven. * @param {MicrowaveOvenMode.ModeOption[]} supportedModes - The supported modes. * * @returns {MatterbridgeEndpoint} The current MatterbridgeEndpoint instance for chaining. * * @remarks * - 8.12. Microwave Oven Mode Cluster * - the supported modes are fixed and cannot be changed at runtime. * - the current mode is persistent among reboots. * - Exactly one entry in the SupportedModes attribute SHALL include the Normal mode tag in the ModeTags field. * - The Normal and Defrost mode tags are mutually exclusive and SHALL NOT both be used together in a mode’s ModeTags. */ createDefaultMicrowaveOvenModeClusterServer(currentMode: number, supportedModes: MicrowaveOvenMode.ModeOption[]): this; /** * Creates a default MicrowaveOvenControl Cluster Server. * * @param {number} selectedWattIndex - The selected watt index. * @param {number[]} supportedWatts - The supported watt values. * @param {number} cookTime - The initial cook time. * @param {number} maxCookTime - The maximum cook time. * * @returns {this} The current MatterbridgeEndpoint instance for chaining. * * @remarks * - 8.13. Microwave Oven Control Cluster * - the supported watt values are fixed and cannot be changed at runtime. * - the maxCookTime is a fixed attribute and cannot be changed at runtime. */ createDefaultMicrowaveOvenControlClusterServer(selectedWattIndex: number, supportedWatts: number[], cookTime: number, maxCookTime: number): this; } declare const MatterbridgeMicrowaveOvenControlServer_base: import("@matter/main").ClusterBehavior.Type<import("@matter/types").ClusterComposer.WithFeatures<import("@matter/types").ClusterType.Of<{ readonly id: 95; readonly name: "MicrowaveOvenControl"; readonly revision: 1; readonly features: { readonly powerAsNumber: import("@matter/types").BitFlag; readonly powerInWatts: import("@matter/types").BitFlag; readonly powerNumberLimits: import("@matter/types").BitFlag; }; readonly attributes: { readonly cookTime: import("@matter/types").Attribute<number, any>; readonly maxCookTime: import("@matter/types").FixedAttribute<number, any>; readonly wattRating: import("@matter/types").OptionalFixedAttribute<number, any>; }; readonly commands: { readonly setCookingParameters: import("@matter/types").Command<import("@matter/types").TypeFromFields<{ cookMode: import("@matter/types").OptionalFieldType<number>; cookTime: import("@matter/types").OptionalFieldType<number>; powerSetting: import("@matter/types").OptionalFieldType<number>; wattSettingIndex: import("@matter/types").OptionalFieldType<number>; startAfterSetting: import("@matter/types").OptionalFieldType<boolean>; }>, void, any>; readonly addMoreTime: import("@matter/types").OptionalCommand<import("@matter/types").TypeFromFields<{ timeToAdd: import("@matter/types").FieldType<number>; }>, void, any>; }; readonly extensions: readonly [{ readonly flags: { readonly powerAsNumber: true; }; readonly component: { readonly attributes: { readonly powerSetting: import("@matter/types").Attribute<number, any>; }; }; }, { readonly flags: { readonly powerNumberLimits: true; }; readonly component: { readonly attributes: { readonly minPower: import("@matter/types").FixedAttribute<number, any>; readonly maxPower: import("@matter/types").FixedAttribute<number, any>; readonly powerStep: import("@matter/types").FixedAttribute<number, any>; }; }; }, { readonly flags: { readonly powerInWatts: true; }; readonly component: { readonly attributes: { readonly supportedWatts: import("@matter/types").FixedAttribute<number[], any>; readonly selectedWattIndex: import("@matter/types").Attribute<number, any>; }; }; }, { readonly flags: { readonly powerNumberLimits: true; readonly powerAsNumber: false; }; readonly component: false; }, { readonly flags: { readonly powerAsNumber: true; readonly powerInWatts: true; }; readonly component: false; }, { readonly flags: { readonly powerAsNumber: false; readonly powerInWatts: false; }; readonly component: false; }]; }>, readonly [MicrowaveOvenControl.Feature.PowerInWatts]>, typeof MicrowaveOvenControlServer, import("@matter/main/behaviors/microwave-oven-control").MicrowaveOvenControlInterface>; /** * Matterbridge Microwave Oven Control Server */ export declare class MatterbridgeMicrowaveOvenControlServer extends MatterbridgeMicrowaveOvenControlServer_base { initialize(): void; setCookingParameters(request: MicrowaveOvenControl.SetCookingParametersRequest): MaybePromise; addMoreTime(request: MicrowaveOvenControl.AddMoreTimeRequest): MaybePromise; } export {}; //# sourceMappingURL=microwaveOven.d.ts.map