Files
flic2hass/types/options.types.d.ts
2025-11-15 15:55:40 -05:00

45 lines
1.1 KiB
TypeScript

type HAmqttOptions = {
debug: boolean;
topics: {
homeassistant: string;
flic: string;
};
};
type MQTTPublishOpt = {
retain?: boolean; // the server should retain this message and send it out again to new subscribers
dup?: boolean; // indicate the message is a duplicate because original wasn't ACKed (QoS > 0 only)
qos?: number;
};
type ButtonControllerOpt = {
debug: boolean;
};
type IRControllerOpt = {
uniqueId: string;
debug: boolean;
};
type FlicHubOptions = {
uniqueId: string;
debug: boolean;
};
type MQTTOptions = {
port: number;
client_id: string | number[];
keep_alive: number | boolean;
clean_session: boolean;
username?: string;
password?: string;
protocol_name: string;
protocol_level: number;
};
type Flic2HassMQTTOptions = MQTTOptions & {
host: string;
};
type Options = {
mqtt: Partial<Flic2HassMQTTOptions> & { host: string };
debug?: boolean;
ha?: Partial<HAmqttOptions>;
flicBtns?: Partial<ButtonControllerOpt> & { disabled?: boolean };
flicIR?: Partial<IRControllerOpt> & { disabled?: boolean };
flicHub?: Partial<FlicHubOptions> & { disabled?: boolean };
};