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

53 lines (52 loc) 1.8 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 platformGenericDevice { readonly platform: HttpSensorsAndSwitchesHomebridgePlatform; readonly accessory: PlatformAccessory; service: 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; urlDeviceControl: string; methodUpdate: boolean; mqttReconnectInterval: string; mqttBroker: string; mqttPort: string; mqttUsername: string; mqttPassword: string; discordWebhook: string; discordUsername: string; discordAvatar: string; discordMessage: string; paramNames: Record<string, string>; mqttTopics: Record<string, string>; DeviceStates: Record<string, number>; DeviceStatusRanges: Record<string, [number, number]>; constructor(platform: HttpSensorsAndSwitchesHomebridgePlatform, accessory: PlatformAccessory); private getStateDefinition; private getStatus; private updateDeviceStatusFromSharedData; private getDeviceState; private processGetDeviceStatusData; private setDeviceState; private initMQTT; private publishMQTTmessage; private initDiscordWebhooks; }