UNPKG

matterbridge

Version:
93 lines 5.7 kB
/** * @description This file contains the Refrigerator class. * @file src/devices/refrigerator.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 { Semtag } from '@matter/types'; import { ModeBase } from '@matter/main/clusters/mode-base'; import { RefrigeratorAndTemperatureControlledCabinetModeServer } from '@matter/main/behaviors/refrigerator-and-temperature-controlled-cabinet-mode'; import { RefrigeratorAndTemperatureControlledCabinetMode } from '@matter/main/clusters/refrigerator-and-temperature-controlled-cabinet-mode'; import { MatterbridgeEndpoint } from '../matterbridgeEndpoint.js'; export declare class Refrigerator extends MatterbridgeEndpoint { /** * Creates an instance of the Refrigerator class. * * @param {string} name - The name of the refrigerator. * @param {string} serial - The serial number of the refrigerator. * * @remarks * 13.2 A refrigerator represents a device that contains one or more cabinets that are capable of chilling or * freezing food. Examples of consumer products that MAY make use of this device type include refrigerators, * freezers, and wine coolers. * A refrigerator is always defined via endpoint composition. * - Use `addCabinet` to add one or more cabinets to the refrigerator. */ constructor(name: string, serial: string); /** * Adds a Level Temperature Controlled Cabinet Cooler to the refrigerator. * * @param {string} name - The name of the cabinet. * @param {Semtag[]} tagList - The tagList associated with the cabinet. * @param {number} currentMode - The current mode of the cabinet. Defaults to 1 (which corresponds to 'Auto'). * @param {RefrigeratorAndTemperatureControlledCabinetMode.ModeOption[]} supportedModes - The supported modes for the cabinet. Defaults to 'Auto', 'RapidCool', and 'RapidFreeze'. * @param {number} selectedTemperatureLevel - The selected temperature level as an index of the supportedTemperatureLevels array. Defaults to 2 (which corresponds to 'Level 3'). * @param {string[]} supportedTemperatureLevels - The list of supported temperature levels for the cabinet. Defaults to ['Level 1', 'Level 2', 'Level 3', 'Level 4', 'Level 5']. * @param {number} currentTemperature - The current temperature of the cabinet in degrees Celsius. Defaults to 1000 (which corresponds to 10.00 degrees Celsius). * * @returns {MatterbridgeEndpoint} The MatterbridgeEndpoint instance representing the cabinet. * * @remarks * 13.4.1 A Temperature Controlled Cabinet Cooler is a device that provides a cooled space for chilling food. * It is typically installed within a refrigerator. * * Example usage with specific namespace tags: * ``` * refrigerator.addCabinet('Refrigerator Top', [ * { mfgCode: null, namespaceId: PositionTag.Top.namespaceId, tag: PositionTag.Top.tag, label: 'Refrigerator Top' }, * { mfgCode: null, namespaceId: RefrigeratorTag.Refrigerator.namespaceId, tag: RefrigeratorTag.Refrigerator.tag, label: RefrigeratorTag.Refrigerator.label }, * ]); * refrigerator.addCabinet('Freezer Bottom', [ * { mfgCode: null, namespaceId: PositionTag.Bottom.namespaceId, tag: PositionTag.Bottom.tag, label: 'Freezer Bottom' }, * { mfgCode: null, namespaceId: RefrigeratorTag.Freezer.namespaceId, tag: RefrigeratorTag.Freezer.tag, label: RefrigeratorTag.Freezer.label }, * ]); * ``` */ addCabinet(name: string, tagList: Semtag[], currentMode?: number, supportedModes?: RefrigeratorAndTemperatureControlledCabinetMode.ModeOption[], selectedTemperatureLevel?: number, supportedTemperatureLevels?: string[], currentTemperature?: number): MatterbridgeEndpoint; /** * Creates a default RefrigeratorAndTemperatureControlledCabinetMode Cluster Server. * * @param {MatterbridgeEndpoint} endpoint - The Matterbridge endpoint instance. * @param {number} currentMode - The current mode of the oven. * @param {RefrigeratorAndTemperatureControlledCabinetMode.ModeOption[]} supportedModes - The supported modes for the refrigerator and temperature controlled cabinet. * * @returns {MatterbridgeEndpoint} The current MatterbridgeEndpoint instance for chaining. * * @remarks * - supportedModes is a fixed attribute. It cannot be changed at runtime. * - currentMode persists across reboots. */ createDefaultRefrigeratorAndTemperatureControlledCabinetModeClusterServer(endpoint: MatterbridgeEndpoint, currentMode: number, supportedModes: RefrigeratorAndTemperatureControlledCabinetMode.ModeOption[]): MatterbridgeEndpoint; } export declare class MatterbridgeRefrigeratorAndTemperatureControlledCabinetModeServer extends RefrigeratorAndTemperatureControlledCabinetModeServer { initialize(): void; changeToMode(request: ModeBase.ChangeToModeRequest): MaybePromise<ModeBase.ChangeToModeResponse>; } //# sourceMappingURL=refrigerator.d.ts.map