homebridge-http-sensors-switches
Version:
This plugin communicates with your devices over HTTP or MQTT. Currently it supports Light Bulb, Switches, Outlets, Fan, Garage Door, Shades / Blinds, Temperature/Humidity, Motion, Contact and Occupancy sensor, Door, Sprinkler, Valve, Air Quality, Smoke, C
97 lines (96 loc) • 2.95 kB
TypeScript
import { PlatformAccessory, Service } from 'homebridge';
import type { HttpSensorsAndSwitchesHomebridgePlatform } from './platform.js';
import mqtt from 'mqtt';
/**
* Platform Accessory
* An instance of this class is created for each accessory your platform registers
* Each accessory may expose multiple services of different service types.
*/
export declare class platformLightBulb {
readonly platform: HttpSensorsAndSwitchesHomebridgePlatform;
readonly accessory: PlatformAccessory;
service: Service;
mqttClient: mqtt.MqttClient;
private sharedPollingInstance?;
private isReachable;
enableLogging: boolean;
ignoreHttpsCertErrors: boolean;
trustedCert?: string;
sharedPolling: boolean;
sharedPollingId: string;
sharedPollingInterval: number;
deviceId: string;
deviceType: string;
deviceName: string;
deviceManufacturer: string;
deviceModel: string;
deviceSerialNumber: string;
deviceFirmwareVersion: string;
urlON: string;
urlOFF: string;
url: string;
urlStatus: string;
statusStateParam: string;
statusOnCheck: string;
statusOffCheck: string;
useRGB: boolean;
useBrightness255: boolean;
useColorTKelvin: boolean;
rgbParamName: string;
urlLightBulbControl: string;
brightnessParamName: string;
saturationParamName: string;
hueParamName: string;
colorTemperatureParamName: string;
mqttReconnectInterval: number;
mqttBroker: string;
mqttPort: string;
mqttUsername: string;
mqttPassword: string;
mqttSwitch: string;
mqttRGB: string;
mqttBrightness: string;
mqttHue: string;
mqttSaturation: string;
mqttColorTemperature: string;
discordWebhook: string;
discordUsername: string;
discordAvatar: string;
discordMessage: string;
lightBulbStates: {
On: boolean;
Brightness: number;
Hue: number;
Saturation: number;
ColorTemperature: number;
RGB: string;
};
private lightBulbRanges;
private httpsAgentManager;
constructor(platform: HttpSensorsAndSwitchesHomebridgePlatform, accessory: PlatformAccessory);
private wrapGetHandler;
private wrapSetHandler;
private getStatus;
private updateSwitchState;
private updateLightBulbStatusFromSharedData;
private getData;
private processLightBulbStatusData;
/**
* Handle "SET" requests from HomeKit
* These are sent when the user changes the state of an accessory, for example, turning on a Light bulb.
*/
private setOn;
private setBrightness;
private setHue;
private setSaturation;
private setColorTemperature;
private initMQTT;
private publishMQTTmessage;
private convertToHSV;
private convertToRGB;
private updateAndSendRGB;
private checkAndFixValue;
private convertBrightness;
private convertColorTemperature;
private initDiscordWebhooks;
}