import { HomieElement } from "./HomieElement"; import { HomieDevice } from "./HomieDevice"; import { HomieProperty } from "./HomieProperty"; import { DictionaryStore } from "./misc"; import { HomieID, NodeDescription, NodePointer, ObjectMap, PropertyDescription } from "./model"; import { NodeAttributes } from "./model"; import { Observable } from "rxjs"; import { IClientPublishOptions } from "mqtt"; import { MqttMessage } from "./mqtt"; export declare class HomieNode extends HomieElement { readonly device: HomieDevice; readonly topic: string; readonly pointer: NodePointer; set descriptionUpdateNeeded(value: boolean); protected propertyStore: DictionaryStore; properties$: Observable>; propertiesChange$: Observable>; get properties(): ObjectMap; constructor(device: HomieDevice, attributes: NodeAttributes); static fromDescription(device: HomieDevice, id: HomieID, description: NodeDescription): HomieNode; getDescription(): NodeDescription; updateFromDescription(description?: NodeDescription): Promise; protected updateProperties(propertyDescriptions: ObjectMap): Promise; onInit(): Promise; /** * @description * Adds a property to the node * Please note: * This will not take care of initializing the property or publishing the '$description' attribute. * In case the device is already initialized. Please use {@link deviceChangeTransaction} or {@link deviceChangeTransactionAsync} to wrap this and ensure to call the properties's {@link HomieProperty.onInit} method. * @param property : new property to add (also accepts undefined values for convinience) * @returns added property */ add(property: T): T; /** * Returns property for id. * * @param propId id of property or nullish for convinience * @returns property for the given id. or undefined if property was not found */ get(propId: string | null | undefined): T | undefined; /** * Removes a property from the node. * Please note: * This will not take care of wiping or destroying the property. Neither will the '$description' attribute be published or anything else needed in case the device is already initialized. * In case the device is already initialized. Please use {@link deviceChangeTransaction} or {@link deviceChangeTransactionAsync} to wrap this and ensure to call the property's {@link HomieProperty.onDestroy} method. * @param prop property to remove or property id to remove - or nullish for convinience * @returns Removed property or undefined if the property was not found. */ remove(prop: T | string | null | undefined): T | undefined; protected mqttPublish$(path: string, value: string | null | undefined, options: IClientPublishOptions, publishEmpty: boolean): Observable; protected mqttSubscribe(path: string, retained?: boolean): Observable; wipe$(): Observable; onDestroy(): Promise; }