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

export const blackbirdDomain = "blackbird";
export const blackbirdDefaultName = "Monoprice Blackbird Matrix Switch";

export type TBlackbirdRawData = TSimpleLocalRawData;
export interface IBlackbirdSnapshot extends ISimpleLocalSnapshot {}
export interface IBlackbirdConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantBlackbirdConfig extends IBlackbirdConfig {}

export const blackbirdSampleData: TBlackbirdRawData = {
  input: 'HDMI1',
  output: 'Zone1',
  powered: true,
};

export const blackbirdProfile: ISimpleLocalIntegrationProfile = {
  domain: "blackbird",
  displayName: "Monoprice Blackbird Matrix Switch",
  manufacturer: "Monoprice",
  model: "Blackbird matrix switch",
  defaultName: "Monoprice Blackbird Matrix Switch",
  defaultProtocol: "local",
  status: "control-runtime",
  platforms: [
    "switch",
    "sensor",
    "media_player"
  ],
  serviceDomains: [
    "switch",
    "media_player"
  ],
  controlServices: [
    "turn_on",
    "turn_off",
    "toggle",
    "select_source"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "blackbird",
    "monoprice",
    "matrix",
    "hdmi"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/blackbird",
    upstreamDomain: "blackbird",
    iotClass: "local_polling",
    qualityScale: "legacy",
    requirements: [
      "pyblackbird==0.6"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: true,
    sampleData: blackbirdSampleData,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "turn_on",
        "turn_off",
        "toggle",
        "select_source"
      ],
      platforms: [
        "switch",
        "sensor",
        "media_player"
      ],
      controls: true
    },
    localApi: {
      implemented: [
        "manual local endpoint setup",
        "snapshot, raw data, snapshotProvider, and injected native client operation",
        "generic HTTP/TCP local transport when config.path, config.transport, or documented defaults are supplied"
      ],
      explicitUnsupported: [
        "claiming live command success without injected client.execute or commandExecutor",
        "cloud account flows and remote API polling",
        "device-specific protocol features not represented by snapshot/rawData/client/executor inputs"
      ]
    }
  }
};
