domoticz-api-linker
Version:
Domoticz API Javascript Bridge Connector
91 lines (90 loc) • 3.13 kB
TypeScript
import { DomoticzApiConnector } from '../index';
import { EDZ_DEVICE_HUMIDITY, EDZ_HUMIDITY, EDZ_DEVICE, EDZ_SWITCH_COMMAND, IdzDevice, IdzResult } from '../types';
declare class DeviceManager {
domoticzApi: DomoticzApiConnector;
constructor(domoticzApi: DomoticzApiConnector);
/**
* Get all devices, including the hidden ones
*/
items(): Promise<IdzDevice[]>;
/**
* Get all devices idx, names, and statuses without details
* @returns
*/
itemsList(): Promise<any[]>;
/**
* Get a specific device using the device identifier Idx
* @param {number} idx
*/
getByIdx(idx: number): Promise<IdzDevice | null>;
/**
* Retrieve all devices of a specified type
* @param {EDZ_DEVICE} filter
* @param {string} orderBy
*/
getByType(filter: EDZ_DEVICE, orderBy?: string): Promise<IdzDevice[]>;
/**
* Return devices marked as *favorites*
*/
getFavorites(): Promise<IdzDevice[]>;
/**
* Action a Light/Switch
* @param {number} idx
* @param {EDZ_SWITCH_COMMAND} command "On|Off"
*/
switch(idx: number, command?: EDZ_SWITCH_COMMAND): Promise<IdzResult<null>>;
/**
* Ask Domoticz to toggle a Light/Switch
* @param {number} idx
*/
toggle(idx: number): Promise<IdzResult<null>>;
/**
* Rename the device identified by idx
* @param {number} idx
* @param {string} name
*/
rename(idx: number, name: string): Promise<IdzResult<null>>;
/**
* Set/Remove the protection on a device identified by idx
* @param {number} idx
* @param {boolean} enable
*/
protect(idx: number, enable?: boolean): Promise<IdzResult<null>>;
/**
* Set the new temperature
*
* @param {number} idx
* @param {number} temperature
* @returns
*/
updateTemperature(idx: number, temperature: number): Promise<IdzResult<null>>;
/**
* Set the humidity datas of a device
*
* @param {number} idx Domoticz Device ID
* @param {number} humidityPercent Ex: 45
* @param {EDZ_HUMIDITY} humidityState [0: Normal, 1: Confortable, 2: Dry, 3: Wet]
* @returns
*/
updateHumidity(idx: number, humidityPercent: number, humidityState: EDZ_HUMIDITY): Promise<IdzResult<null> | null>;
/**
* Set the barometer pressure and define the barometer forecast.
*
* @param {number} idx
* @param {int} barometer Atmospheric Pressure
* @param {deviceHumidityType} deviceHumidityType use a deviceHumidityGeneralType (if device.Type is 'General'), or deviceHumidityType otherwise.
*
* @returns
*/
updateBarometer(idx: number, barometer: number, deviceHumidityType: EDZ_DEVICE_HUMIDITY): Promise<IdzResult<null>>;
/**
* Generic update of a devices
*
* @param {number} idx
* @param {string} sValue
* @param {string} nValue
* @returns
*/
updateDevice(idx: number, svalue: string, nvalue?: string): Promise<IdzResult<null>>;
}
export { DeviceManager };