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

export const ombiDomain = "ombi";
export const ombiDefaultName = "Ombi";

export type TOmbiRawData = TSimpleLocalRawData;
export interface IOmbiSnapshot extends ISimpleLocalSnapshot {}
export interface IOmbiConfig extends ISimpleLocalConfig {
  url?: string;
  urlbase?: string;
  urlBase?: string;
  ssl?: boolean;
  macAddress?: string;
  deviceId?: string;
}
export interface IHomeAssistantOmbiConfig extends IOmbiConfig {}

export const ombiProfile: ISimpleLocalIntegrationProfile = {
  domain: ombiDomain,
  displayName: "Ombi",
  manufacturer: "Ombi",
  model: "Ombi local integration",
  defaultName: ombiDefaultName,
  defaultPort: 5000,
  defaultProtocol: 'http',
  status: "control-runtime",
  platforms: [
    "sensor",
  ],
  serviceDomains: [],
  controlServices: [
    "submit_movie_request",
    "submit_music_request",
    "submit_tv_request",
  ],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "ombi",
    "Ombi",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/ombi",
    "upstreamDomain": "ombi",
    "iotClass": "local_polling",
    "qualityScale": "legacy",
    "requirements": [
      "pyombi==0.1.10",
    ],
    "codeowners": [
      "@larssont",
    ],
    "configFlow": false,
    "documentation": "https://www.home-assistant.io/integrations/ombi",
    "runtime": {
      "type": "control-runtime",
      "services": [
        "snapshot",
        "status",
        "refresh",
        "submit_movie_request",
        "submit_music_request",
        "submit_tv_request",
      ],
      "platforms": [
        "sensor",
      ],
      "controls": "native HTTP request submission with injected executor override",
    },
    "localApi": {
      "implemented": [
        "native HTTP polling for Ombi api/v1 Status and request count endpoints",
        "native HTTP request submission through Ombi api/v1 search and request endpoints",
        "ApiKey and bearer-token password authentication matching pyombi 0.1.10",
        "manual local setup for Ombi endpoints, snapshots, rawData, snapshotProvider, and injected native clients",
        "runtime mapping for Ombi device snapshots and Home Assistant platform metadata",
        "safe command delegation to injected client.execute or commandExecutor when provided",
      ],
      "explicitUnsupported": [
        "Ombi pairing, user administration, media server configuration, or non-api/v1 endpoints",
        "Home Assistant entity registry migrations and repair flows",
        "claiming request submission success without a real native HTTP response, injected client.execute, or commandExecutor",
      ],
    },
  },
};
