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

export const lw12wifiDomain = "lw12wifi";
export const lw12wifiDefaultName = "LAGUTE LW-12";

export type TLw12wifiRawData = TSimpleLocalRawData;
export interface ILw12wifiSnapshot extends ISimpleLocalSnapshot {}
export interface ILw12wifiConfig extends ISimpleLocalConfig {
  url?: string;
  macAddress?: string;
  deviceId?: string;
}

export const lw12wifiProfile: ISimpleLocalIntegrationProfile = {
  domain: lw12wifiDomain,
  displayName: "LAGUTE LW-12",
  manufacturer: "LAGUTE LW-12",
  model: "LAGUTE LW-12 local integration",
  defaultName: lw12wifiDefaultName,
  defaultProtocol: 'local',
  status: "read-only-runtime",
  platforms: [
    "light",
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "lw12wifi",
    "LAGUTE LW-12",
    "Lw12wifi",
    "LAGUTE",
    "LW-12",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/lw12wifi",
    "upstreamDomain": "lw12wifi",
    "iotClass": "local_polling",
    "qualityScale": "legacy",
    "requirements": [
      "lw12==0.9.2",
    ],
    "configFlow": false,
    "documentation": "https://www.home-assistant.io/integrations/lw12wifi",
    "runtime": {
      "type": "read-only-runtime",
      "services": [
        "snapshot",
        "status",
        "refresh",
      ],
      "platforms": [
        "light",
      ],
      "controls": false,
      "blocker": "Home Assistant uses lw12==0.9.2, whose source sends 9-byte binary UDP datagrams to port 5000; this task only allows HTTP/TCP/TLS/file implementations with existing helpers, so no native LW-12 UDP control is claimed.",
    },
    "localApi": {
      "implemented": [
        "manual local setup for LAGUTE LW-12 endpoints, snapshots, rawData, snapshotProvider, and injected native clients",
        "runtime mapping for LAGUTE LW-12 device snapshots and Home Assistant platform metadata",
        "safe snapshotProvider and injected native-client snapshot behavior only",
      ],
      "explicitUnsupported": [
        "native LAGUTE LW-12 live control because the documented lw12 Python library uses binary UDP datagrams, not an HTTP/TCP/TLS/file protocol available to this implementation pass",
        "claiming light_on, light_off, brightness, transition, RGB color, or effect write success without a real LW-12 UDP-capable native client outside this package",
        "Home Assistant entity registry migrations and repair flows",
        "claiming readback/polling state; the Home Assistant entity is assumed-state and the lw12 library exposes UDP writes without state reads",
      ],
    },
  },
};
