daikin-controller-cloud
Version:
Interact with Daikin Cloud devices and retrieve Tokens
91 lines (90 loc) • 3.12 kB
TypeScript
import type { OnectaClient } from './onecta/oidc-client.js';
import { EventEmitter } from "events";
interface DaikinCloudDeviceEvents {
"updated": [];
}
type SetDataOptions = {
/**
* If true, the writable check "settable" will be ignored.
* @default false
*/
ignoreWritableCheck?: boolean;
/**
* If true, the local Device data will be updated without waiting for a new cloud update
* @default false
*/
updateLocalData?: boolean;
};
/**
* Class to represent and control one Daikin Cloud Device
*/
export declare class DaikinCloudDevice extends EventEmitter<DaikinCloudDeviceEvents> {
#private;
desc: any;
managementPoints: Record<string, any>;
/**
* Constructor, called from DaikinCloud class when initializing all devices
*
* @param deviceDescription object with device description from Cloud request
* @param client Instance of DaikinCloud used for communication
*/
constructor(deviceDescription: any, client: OnectaClient);
/**
* Set a device description and parse/traverse data structure
*
* @param desc Device Description
*/
setDescription(desc: any): void;
/**
* Get Daikin Device UUID
* @returns Device Id (UUID)
*/
getId(): string;
/**
* Get the original Daikin Device Description
*
* @returns Daikin Device Description
*/
getDescription(): any;
/**
* Get the timestamp when data were last updated
*
* @returns {Date} Last updated timestamp
*/
getLastUpdated(): Date;
/**
* Get the info if device is connected to cloud
*
* @returns {boolean} Connected status
*/
isCloudConnectionUp(): boolean;
/**
* Get a current data object (includes value and meta information).
* Without any parameter the full internal data structure is returned and
* can be further detailed by sending parameters
*
* @param {string} [managementPoint] Management point name
* @param {string} [dataPoint] Datapoint name for management point
* @param {string} [dataPointPath] further detailed datapoints with subpath data
* @returns {object|null} Data object
*/
getData(managementPoint: any, dataPoint: any, dataPointPath: any): any;
/**
* Update the data of this device from the cloud
*
* @returns {Promise<boolean>}
*/
updateData(): Promise<boolean>;
/**
* Set a datapoint on this device
*
* @param {string} managementPoint Management point name
* @param {string} dataPoint Datapoint name for management point
* @param {string} [dataPointPath] further detailed datapoints with subpath data, if needed
* @param {number|string} value Value to set
* @param {SetDataOptions|boolean} options Options object for setData
* @returns {Promise<Object|boolean>} should return a true - or if a body is returned teh body object (can this happen?)
*/
setData(managementPoint: any, dataPoint: any, dataPointPath: any, value: any, options?: SetDataOptions | boolean): Promise<any>;
}
export {};