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

export const ccm15Domain = "ccm15";
export const ccm15DefaultName = "Midea ccm15 AC Controller";

export type TCcm15RawData = TSimpleLocalRawData;
export interface ICcm15Snapshot extends ISimpleLocalSnapshot {}
export interface ICcm15Config extends ISimpleLocalConfig {}
export interface IHomeAssistantCcm15Config extends ICcm15Config {}

export const ccm15Profile: ISimpleLocalIntegrationProfile = {
  domain: "ccm15",
  displayName: "Midea ccm15 AC Controller",
  manufacturer: "Midea",
  model: "CCM15 AC controller",
  defaultName: "Midea ccm15 AC Controller",
  defaultProtocol: "local",
  status: "control-runtime",
  platforms: [
    "climate",
    "sensor",
    "fan"
  ],
  serviceDomains: [
    "climate",
    "fan"
  ],
  controlServices: [
    "set_temperature",
    "set_hvac_mode",
    "set_percentage",
    "turn_on",
    "turn_off"
  ],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "midea",
    "ccm15",
    "ac"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/ccm15",
    upstreamDomain: "ccm15",
    integrationType: "hub",
    iotClass: "local_polling",
    requirements: [
      "py_ccm15==0.1.2"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      "@ocalvo"
    ],
    configFlow: true,
    runtime: {
      type: "control-runtime",
      services: [
        "snapshot",
        "status",
        "refresh",
        "set_temperature",
        "set_hvac_mode",
        "set_percentage",
        "turn_on",
        "turn_off"
      ],
      platforms: [
        "climate",
        "sensor",
        "fan"
      ],
      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"
      ]
    }
  }
};
