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

export const youlessDomain = "youless";
export const youlessDefaultName = "YouLess";

export type TYoulessRawData = TSimpleLocalRawData;
export interface IYoulessSnapshot extends ISimpleLocalSnapshot {}
export interface IYoulessConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantYoulessConfig extends IYoulessConfig {}

export const youlessProfile: ISimpleLocalIntegrationProfile = {
  domain: "youless",
  displayName: "YouLess",
  manufacturer: "YouLess",
  model: "Energy monitor",
  defaultName: "YouLess",
  defaultPort: 80,
  defaultHttpPath: "/a?f=j",
  defaultProtocol: "http",
  status: "read-only-runtime",
  platforms: [
    "sensor",
    "binary_sensor"
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    "manual",
    "mdns",
    "ssdp",
    "http",
    "custom"
  ],
  discoveryKeywords: [
    "youless",
    "energy",
    "meter"
  ],
  metadata: {
    source: "home-assistant/core",
    upstreamPath: "homeassistant/components/youless",
    upstreamDomain: "youless",
    integrationType: "device",
    iotClass: "local_polling",
    requirements: [
      "youless-api==2.2.0"
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      "@gjong"
    ],
    configFlow: true,
    runtime: {
      type: "read-only-runtime",
      services: [
        "snapshot",
        "status",
        "refresh"
      ],
      platforms: [
        "sensor",
        "binary_sensor"
      ],
      controls: false
    },
    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"
      ]
    }
  }
};
