UNPKG

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, Air Quality, Smoke, Carbon Dioxide and Light

50 lines (49 loc) 1.71 kB
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 platformSensorGeneric { readonly platform: HttpSensorsAndSwitchesHomebridgePlatform; readonly accessory: PlatformAccessory; sensorService: Service; mqttClient: mqtt.MqttClient; private sharedPollingInstance?; enableLogging: boolean; sharedPolling: boolean; sharedPollingId: string; sharedPollingInterval: number; deviceId: string; deviceType: string; deviceName: string; deviceManufacturer: string; deviceModel: string; deviceSerialNumber: string; deviceFirmwareVersion: string; urlStatus: string; mqttReconnectInterval: string; mqttBroker: string; mqttPort: string; mqttUsername: string; mqttPassword: string; updateInterval: number; discordWebhook: string; discordUsername: string; discordAvatar: string; discordMessage: string; paramNames: Record<string, string>; mqttTopics: Record<string, string>; SensorStates: Record<string, number>; SensorStatusRanges: Record<string, [number, number]>; constructor(platform: HttpSensorsAndSwitchesHomebridgePlatform, accessory: PlatformAccessory); private getStatus; private getStateDefinition; private processSensorState; private updateSensorStatusFromSharedData; private getSensorState; private initMQTT; private initDiscordWebhooks; }