import type { ISimpleLocalConfig, ISimpleLocalIntegrationProfile, ISimpleLocalSnapshot, TSimpleLocalRawData } from '../../core/index.js';

export const locativeDomain = "locative";
export const locativeDefaultName = "Locative";

export type TLocativeRawData = TSimpleLocalRawData;
export interface ILocativeSnapshot extends ISimpleLocalSnapshot {}
export interface ILocativeConfig extends ISimpleLocalConfig {
  url?: string;
  macAddress?: string;
  deviceId?: string;
}
export interface IHomeAssistantLocativeConfig extends ILocativeConfig {}

export const locativeProfile: ISimpleLocalIntegrationProfile = {
  domain: locativeDomain,
  displayName: "Locative",
  manufacturer: "Locative",
  model: "Locative local integration",
  defaultName: locativeDefaultName,
  defaultProtocol: 'local',
  status: "read-only-runtime",
  platforms: [
    "sensor",
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "locative",
    "Locative",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/locative",
    "upstreamDomain": "locative",
    "iotClass": "local_push",
    "dependencies": [
      "webhook",
    ],
    "requirements": [],
    "configFlow": true,
    "documentation": "https://www.home-assistant.io/integrations/locative",
    "runtime": {
      "type": "read-only-runtime",
      "services": [
        "snapshot",
        "status",
        "refresh",
      ],
      "platforms": [
        "device_tracker",
      ],
      "controls": false,
    },
    "localApi": {
      "implemented": [
        "manual local setup for Locative snapshots, rawData, snapshotProvider, and injected native clients",
        "runtime mapping for safe injected Locative device snapshots and Home Assistant metadata",
        "safe command delegation to injected client.execute or commandExecutor only",
      ],
      "explicitUnsupported": [
        "native live Locative polling because upstream Home Assistant locative is an inbound webhook receiver and exposes no pollable local device API",
        "hosting the Locative HTTP webhook endpoint and dispatcher/device_tracker state registry semantics inside this SimpleLocalClient runtime",
        "claiming Locative webhook POST processing without an explicit HTTP server/runtime state store implementation",
        "Home Assistant entity registry migrations and repair flows",
        "claiming command success without injected client.execute or commandExecutor",
      ],
    },
  },
};
