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

export const lannouncerDomain = "lannouncer";
export const lannouncerDefaultName = "LANnouncer";

export type TLannouncerRawData = TSimpleLocalRawData;
export interface ILannouncerSnapshot extends ISimpleLocalSnapshot {}
export interface ILannouncerConfig extends ISimpleLocalConfig {
  url?: string;
  macAddress?: string;
  deviceId?: string;
}
export interface IHomeAssistantLannouncerConfig extends ILannouncerConfig {}

export const lannouncerProfile: ISimpleLocalIntegrationProfile = {
  domain: lannouncerDomain,
  displayName: "LANnouncer",
  manufacturer: "LANnouncer",
  model: "LANnouncer local integration",
  defaultName: lannouncerDefaultName,
  defaultProtocol: 'local',
  status: "read-only-runtime",
  platforms: [
    "sensor",
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "lannouncer",
    "LANnouncer",
    "Lannouncer",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/lannouncer",
    "upstreamDomain": "lannouncer",
    "iotClass": "local_push",
    "qualityScale": "legacy",
    "requirements": [],
    "configFlow": false,
    "documentation": "https://www.home-assistant.io/integrations/lannouncer",
    "runtime": {
      "type": "read-only-runtime",
      "services": [
        "snapshot",
        "status",
        "refresh",
      ],
      "platforms": [
        "sensor",
      ],
      "controls": false,
    },
    "localApi": {
      "status": "no native live client: Home Assistant core only keeps a removal issue for LANnouncer and no longer contains an implementable local device protocol",
      "implemented": [
        "manual local setup for LANnouncer endpoints, snapshots, rawData, snapshotProvider, and injected native clients",
        "runtime mapping for LANnouncer device snapshots and Home Assistant platform metadata",
        "safe command delegation to injected client.execute or commandExecutor only",
      ],
      "explicitUnsupported": [
        "native live LANnouncer polling, pairing, subscription, or writes: Home Assistant's lannouncer component is removed and only creates an integration_removed repair issue",
        "reconstructing the removed Android LANnouncer app protocol without upstream HA source or documented local protocol",
        "Home Assistant entity registry migrations and repair flows",
        "claiming command success without injected client.execute or commandExecutor",
      ],
    },
  },
};
