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

export const lacrosseDomain = "lacrosse";
export const lacrosseDefaultName = "LaCrosse";

export type TLacrosseRawData = TSimpleLocalRawData;
export interface ILacrosseSnapshot extends ISimpleLocalSnapshot {}
export interface ILacrosseConfig extends ISimpleLocalConfig {
  url?: string;
  macAddress?: string;
  deviceId?: string;
}

export const lacrosseProfile: ISimpleLocalIntegrationProfile = {
  domain: lacrosseDomain,
  displayName: "LaCrosse",
  manufacturer: "LaCrosse",
  model: "LaCrosse local integration",
  defaultName: lacrosseDefaultName,
  defaultProtocol: 'local',
  status: "read-only-runtime",
  platforms: [
    "sensor",
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "lacrosse",
    "LaCrosse",
    "Lacrosse",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/lacrosse",
    "upstreamDomain": "lacrosse",
    "iotClass": "local_polling",
    "qualityScale": "legacy",
    "requirements": [
      "pylacrosse==0.4",
    ],
    "configFlow": false,
    "documentation": "https://www.home-assistant.io/integrations/lacrosse",
    "loggers": [
      "pylacrosse",
    ],
    "runtime": {
      "type": "read-only-runtime",
      "status": "snapshot/rawData/injected-client only; Home Assistant live polling uses pylacrosse with pyserial against a JeeLink USB or RFC2217 serial adapter, and no Node serial/RFC2217 stack is available here",
      "services": [
        "snapshot",
        "status",
        "refresh",
      ],
      "platforms": [
        "sensor",
      ],
      "controls": false,
    },
    "localApi": {
      "implemented": [
        "manual snapshot, rawData, snapshotProvider, and injected native client operation",
        "runtime mapping for supplied LaCrosse device snapshots and Home Assistant platform metadata",
        "safe command delegation to injected client.execute or commandExecutor only",
      ],
      "explicitUnsupported": [
        "live LaCrosse/JeeLink polling because Home Assistant uses pylacrosse with pyserial and this package has no Node serial dependency",
        "RFC2217 remote serial access because pylacrosse delegates it to pyserial's RFC2217 implementation and this package has no RFC2217/telnet serial stack",
        "JeeLink radio acquisition and configuration writes without a real serial implementation",
        "Home Assistant entity registry migrations and repair flows",
        "claiming command success without injected client.execute or commandExecutor",
      ],
    },
  },
};
