homebridge-pioneer-avr-2025
Version:
A Pioneer AVR plugin for homebridge. This plugin is designed for Pioneer models that use Telnet Commands (e.g., VSX-922). It may not be compatible with newer models (e.g., VSX-LX304).
110 lines • 4.08 kB
TypeScript
import type { TelnetAvr } from '../telnet-avr/telnetAvr';
import type { Logging } from 'homebridge';
import type { AVState } from './pioneerAvr';
export interface Device {
name: string;
origName: string;
host: string;
port: number;
source: string;
fqdn: string;
maxVolume?: number;
minVolume?: number;
inputSwitches?: string[];
listeningMode?: string;
listeningModeFallback?: string;
listeningModeOther?: string;
}
/**
* This mixin adds volume management methods to a base class, including volume control,
* mute functionality, and listening mode toggling.
* @param Base - The base class to extend with volume management methods.
* @returns A new class that extends the base class with added volume management functionality.
*/
export declare function VolumeManagementMixin<TBase extends new (...args: any[]) => {
log: Logging;
state: AVState;
lastUserInteraction: number;
telnetAvr: TelnetAvr;
isReady: boolean;
maxVolume: number;
minVolume: number;
device: Device;
platform: any;
}>(Base: TBase): {
new (...args: any[]): {
telnetAvr: TelnetAvr;
device: Device;
platform: any;
updateVolumeTimeout: NodeJS.Timeout | null;
cancelVolumeDownSteps: boolean;
activeVolumeDownStepTimeouts: NodeJS.Timeout[];
lastSetVolume: string;
/**
* Placeholder for setting the volume of the AVR.
* Intended to be overridden externally.
*/
functionSetLightbulbVolume(_argument?: any): void;
functionSetLightbulbMuted(_argument?: any): void;
functionSetSwitchListeningMode(_argument?: any): void;
/**
* Sends a volume status query to the AVR and updates the volume state.
* @param callback - Function to run after updating the volume.
*/
__updateVolume(callback: (error: any, response: string) => void): Promise<void>;
/**
* Sends a mute status query to the AVR and updates the mute state.
* @param callback - Function to run after updating the mute state.
*/
__updateMute(callback: (error: any, response: string) => void): Promise<void>;
/**
* Retrieves the current volume status.
* @param callback - The function to handle the volume result.
*/
volumeStatus(callback: (err: any, volume?: number) => void): void;
/**
* Sets a specific volume on the AVR.
* @param targetVolume - The desired volume level.
* @param callback - The function to call after setting the volume.
*/
setVolume(targetVolume: number, callback?: (error: any, response: string) => void): void;
/**
* Increases the volume by one step.
*/
volumeUp(): void;
/**
* Decreases the volume by three steps, with a delay of 100ms between each step.
*/
volumeDown(): void;
/**
* Retrieves the mute status of the AVR.
* @param callback - The function to handle the mute result.
*/
muteStatus(callback: (err: any, muted?: boolean) => void): void;
/**
* Sends a mute-on command to the AVR.
*/
muteOn(): void;
/**
* Sends a mute-off command to the AVR.
*/
muteOff(): void;
/**
* Sends a query to update the current listening mode.
* @param callback - The function to handle the response.
*/
__updateListeningMode(callback: (error: any, response: string) => void): void;
/**
* Toggles the listening mode between presets.
* @param callback - Optional function to handle the toggle result.
*/
toggleListeningMode(callback?: (error: any, response: string) => void): void;
log: Logging;
state: AVState;
lastUserInteraction: number;
isReady: boolean;
maxVolume: number;
minVolume: number;
};
} & TBase;
//# sourceMappingURL=volume.d.ts.map