import type { BaseComponentDiscovery } from "./BaseEntityDiscovery.ts";
import {MakeEntity} from './utils';

/**
 * @see https://www.home-assistant.io/integrations/device_tracker.mqtt
 */

export interface DeviceTrackerComponentDiscovery extends BaseComponentDiscovery {
	platform: 'device_tracker';

	payload_home?: string;
	payload_not_home?: string;
	payload_reset?: string;
	source_type?: 'gps' | 'router' | 'bluetooth' | 'bluetooth_le';

    /**
     * The MQTT topic subscribed to receive state updates.
	 * Does not need to be set if json_attributes_topic is set, and it has `latitude` and `longitude` attributes.
     */
    state_topic?: string;

    /**
     * Defines a template to extract a value from the payload.
     */
    value_template?: string;
}

export type DeviceTrackerDiscovery = MakeEntity<DeviceTrackerComponentDiscovery>;
