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

export const monopriceDomain = "monoprice";
export const monopriceDefaultName = "Monoprice 6-Zone Amplifier";

export type TMonopriceRawData = TSimpleLocalRawData;
export interface IMonopriceSnapshot extends ISimpleLocalSnapshot {}
export interface IMonopriceConfig extends ISimpleLocalConfig {
  url?: string;
  macAddress?: string;
  deviceId?: string;
}
export interface IHomeAssistantMonopriceConfig extends IMonopriceConfig {}

export const monopriceProfile: ISimpleLocalIntegrationProfile = {
  domain: monopriceDomain,
  displayName: "Monoprice 6-Zone Amplifier",
  manufacturer: "Monoprice 6-Zone Amplifier",
  model: "Monoprice 6-Zone Amplifier local integration",
  defaultName: monopriceDefaultName,
  defaultProtocol: 'local',
  status: "control-runtime",
  platforms: [
    "media_player",
  ],
  serviceDomains: [
    "media_player",
  ],
  controlServices: [
    "media_pause",
    "media_play",
    "restore",
    "snapshot",
    "volume_down",
    "volume_up",
  ],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    "monoprice",
    "Monoprice 6-Zone Amplifier",
    "Monoprice",
    "6-Zone",
    "Amplifier",
  ],
  metadata: {
    "source": "home-assistant/core",
    "upstreamPath": "homeassistant/components/monoprice",
    "upstreamDomain": "monoprice",
    "integrationType": "hub",
    "iotClass": "local_polling",
    "requirements": [
      "pymonoprice==0.5",
    ],
    "codeowners": [
      "@etsinko",
      "@OnFreund",
    ],
    "configFlow": true,
    "documentation": "https://www.home-assistant.io/integrations/monoprice",
    "loggers": [
      "pymonoprice",
    ],
    "runtime": {
      "type": "control-runtime",
      "services": [
        "snapshot",
        "status",
        "refresh",
        "media_pause",
        "media_play",
        "restore",
        "volume_down",
        "volume_up",
      ],
      "platforms": [
        "media_player",
      ],
      "controls": "injected only; native live polling/control is blocked because HA/pymonoprice requires pyserial/serial_asyncio access to an RS-232 serial port",
    },
    "localApi": {
      "implemented": [
        "manual local setup for Monoprice 6-Zone Amplifier snapshots, rawData, snapshotProvider, and injected native clients",
        "runtime mapping for Monoprice 6-Zone Amplifier device snapshots and Home Assistant platform metadata",
        "safe command delegation to injected client.execute or commandExecutor only",
      ],
      "explicitUnsupported": [
        "native live Monoprice polling/control because Home Assistant uses pymonoprice over pyserial/serial_asyncio for an RS-232 serial port, and this package cannot add a serial transport dependency",
        "claiming local HTTP/TCP support; HA source and pymonoprice expose only the amplifier ASCII protocol through a serial port URL",
        "claiming live Monoprice 6-Zone Amplifier polling or write success without an injected native client or snapshotProvider",
        "Home Assistant entity registry migrations and repair flows",
        "claiming command success without injected client.execute or commandExecutor",
      ],
    },
  },
};
