UNPKG

node-switchbot

Version:

The node-switchbot is a Node.js module which allows you to control your Switchbot Devices through Bluetooth (BLE).

236 lines 7.48 kB
export interface webhookRequest { action: string; url: string; deviceList: string; } export interface setupWebhookResponse { statusCode: number; body: object; message: string; } export interface queryWebhookResponse { statusCode: number; body: WebhookDetail[]; message: string; } export interface WebhookDetail { url: string; createTime: number; lastUpdateTime: number; deviceList: string; enable: boolean; } export interface updateWebhookResponse { statusCode: number; body: object; message: string; } export interface deleteWebhookResponse { statusCode: number; body: object; message: string; } interface deviceWebhook { eventType: string; eventVersion: string; context: deviceWebhookContext; } export { deviceWebhook }; export interface deviceWebhookContext { deviceMac: string; deviceType: string; timeOfSample: number; } export type botWebhookContext = deviceWebhookContext & { power: string; battery: number; deviceMode: 'pressMode' | 'switchMode' | 'customizeMode'; }; export type curtainWebhookContext = deviceWebhookContext & { calibrate: boolean; group: boolean; slidePosition: number; battery: number; }; export type curtain3WebhookContext = deviceWebhookContext & { calibrate: boolean; group: boolean; slidePosition: number; battery: number; }; export type motionSensorWebhookContext = deviceWebhookContext & { detectionState: 'NOT_DETECTED' | 'DETECTED'; battery: number; }; export type contactSensorWebhookContext = deviceWebhookContext & { detectionState: 'NOT_DETECTED' | 'DETECTED'; battery: number; doorMode: 'IN_DOOR' | 'OUT_DOOR'; brightness: 'dim' | 'bright'; openState: 'open' | 'close' | 'timeOutNotClose'; }; export type waterLeakDetectorWebhookContext = deviceWebhookContext & { detectionState: 0 | 1; battery: number; }; export type meterWebhookContext = deviceWebhookContext & { temperature: number; battery: number; scale: 'CELSIUS' | 'FAHRENHEIT'; humidity: number; }; export type meterPlusWebhookContext = deviceWebhookContext & { temperature: number; battery: number; scale: 'CELSIUS' | 'FAHRENHEIT'; humidity: number; }; export type meterProWebhookContext = deviceWebhookContext & { temperature: number; battery: number; scale: 'CELSIUS' | 'FAHRENHEIT'; humidity: number; }; export type meterProCO2WebhookContext = deviceWebhookContext & { temperature: number; battery: number; scale: 'CELSIUS' | 'FAHRENHEIT'; humidity: number; CO2: number; }; export type outdoorMeterWebhookContext = deviceWebhookContext & { temperature: number; battery: number; scale: 'CELSIUS' | 'FAHRENHEIT'; humidity: number; }; export type lockWebhookContext = deviceWebhookContext & { lockState: 'UNLOCKED' | 'LOCKED' | 'JAMMED'; battery: number; }; export type lockProWebhookContext = deviceWebhookContext & { lockState: 'UNLOCKED' | 'LOCKED' | 'JAMMED'; battery: number; }; export type indoorCameraWebhookContext = deviceWebhookContext & { detectionState: 'DETECTED'; }; export type panTiltCamWebhookContext = deviceWebhookContext & { detectionState: 'DETECTED'; }; export type colorBulbWebhookContext = deviceWebhookContext & { powerState: 'ON' | 'OFF'; brightness: number; color: string; colorTemperature: number; }; export type stripLightWebhookContext = deviceWebhookContext & { powerState: 'ON' | 'OFF'; brightness: number; color: string; }; export type plugWebhookContext = deviceWebhookContext & { powerState: 'ON' | 'OFF'; }; export type plugMiniUSWebhookContext = deviceWebhookContext & { powerState: 'ON' | 'OFF'; }; export type plugMiniJPWebhookContext = deviceWebhookContext & { powerState: 'ON' | 'OFF'; }; export type robotVacuumCleanerS1WebhookContext = deviceWebhookContext & { workingStatus: 'Standby' | 'Clearing' | 'Paused' | 'GotoChargeBase' | 'Charging' | 'ChargeDone' | 'Dormant' | 'InTrouble' | 'InRemoteControl' | 'InDustCollecting'; onlineStatus: 'online' | 'offline'; battery: number; }; export type robotVacuumCleanerS1PlusWebhookContext = deviceWebhookContext & { workingStatus: 'Standby' | 'Clearing' | 'Paused' | 'GotoChargeBase' | 'Charging' | 'ChargeDone' | 'Dormant' | 'InTrouble' | 'InRemoteControl' | 'InDustCollecting'; onlineStatus: 'online' | 'offline'; battery: number; }; export type floorCleaningRobotS10WebhookContext = deviceWebhookContext & { workingStatus: 'Standby' | 'Clearing' | 'Paused' | 'GotoChargeBase' | 'Charging' | 'ChargeDone' | 'Dormant' | 'InTrouble' | 'InRemoteControl' | 'InDustCollecting'; onlineStatus: 'online' | 'offline'; battery: number; waterBaseBattery: number; taskType: 'standBy' | 'explore' | 'cleanAll' | 'cleanArea' | 'cleanRoom' | 'fillWater' | 'deepWashing' | 'backToCharge' | 'markingWaterBase' | 'drying' | 'collectDust' | 'remoteControl' | 'cleanWithExplorer' | 'fillWaterForHumi' | 'markingHumi'; }; export type ceilingLightWebhookContext = deviceWebhookContext & { powerState: 'ON' | 'OFF'; brightness: number; colorTemperature: number; }; export type ceilingLightProWebhookContext = deviceWebhookContext & { powerState: 'ON' | 'OFF'; brightness: number; colorTemperature: number; }; export type keypadWebhookContext = deviceWebhookContext & { eventName: 'createKey' | 'deleteKey'; commandId: string; result: 'success' | 'failed' | 'timeout'; }; export type keypadTouchWebhookContext = deviceWebhookContext & { eventName: 'createKey' | 'deleteKey'; commandId: string; result: 'success' | 'failed' | 'timeout'; }; export type hub2WebhookContext = deviceWebhookContext & { temperature: number; humidity: number; lightLevel: number; scale: 'CELSIUS' | 'FAHRENHEIT'; }; export type batteryCirculatorFanWebhookContext = deviceWebhookContext & { mode: 'direct' | 'natural' | 'sleep' | 'baby'; version: string; battery: number; powerState: 'ON' | 'OFF'; nightStatus: 'off' | 1 | 2; oscillation: 'on' | 'off'; verticalOscillation: 'on' | 'off'; chargingStatus: 'charging' | 'uncharged'; fanSpeed: number; }; export type circulatorFanWebhookContext = deviceWebhookContext & { mode: 'direct' | 'natural' | 'sleep' | 'baby'; version: string; battery: number; powerState: 'ON' | 'OFF'; nightStatus: 'off' | 1 | 2; oscillation: 'on' | 'off'; verticalOscillation: 'on' | 'off'; fanSpeed: number; }; export type blindTiltWebhookContext = deviceWebhookContext & { version: string; calibrate: boolean; group: boolean; direction: string; slidePosition: number; battery: number; }; export type humidifierWebhookContext = deviceWebhookContext & { temperature: number; humidity: number; scale: 'CELSIUS' | 'FAHRENHEIT'; }; export type humidifier2WebhookContext = deviceWebhookContext & { temperature: number; humidity: number; scale: 'CELSIUS' | 'FAHRENHEIT'; }; export type relaySwitch1Context = deviceWebhookContext & { online: boolean; overTemperature: boolean; switchStatus: 0 | 1; version: string; }; export type relaySwitch1PMContext = deviceWebhookContext & { online: boolean; overTemperature: boolean; switchStatus: 0 | 1; overload: boolean; version: string; }; //# sourceMappingURL=devicewebhookstatus.d.ts.map