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

export const everlightsDomain = 'everlights';
export const everlightsDefaultName = 'EverLights';
export const everlightsControlServices = [
  'turn_on',
  'turn_off',
];

export type TEverlightsRawData = TSimpleLocalRawData;
export interface IEverlightsSnapshot extends ISimpleLocalSnapshot {}
export interface IEverlightsConfig extends ISimpleLocalConfig {
  hosts?: string[];
}
export interface IHomeAssistantEverlightsConfig extends IEverlightsConfig {}

export const everlightsProfile: ISimpleLocalIntegrationProfile = {
  domain: 'everlights',
  displayName: 'EverLights',
  manufacturer: 'EverLights',
  model: 'EverLights controller',
  defaultName: everlightsDefaultName,
  defaultPort: 80,
  defaultProtocol: 'http',
  status: 'control-runtime',
  platforms: [
    'light',
  ],
  serviceDomains: [
    'light',
  ],
  controlServices: everlightsControlServices,
  discoverySources: [
    'manual',
    'http',
    'custom',
  ],
  discoveryKeywords: [
    'everlights',
    'pyeverlights',
    'light',
    'zone',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/everlights',
    upstreamDomain: 'everlights',
    iotClass: 'local_polling',
    qualityScale: 'legacy',
    requirements: [
      'pyeverlights==0.1.0',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [],
    configFlow: false,
    loggers: [
      'pyeverlights',
    ],
    runtime: {
      type: 'control-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
        ...everlightsControlServices,
      ],
      platforms: [
        'light',
      ],
      controls: true,
    },
    localApi: {
      implemented: [
        'manual local controller setup by host, snapshots, rawData, snapshotProvider, and injected native clients',
        'generic local read runtime for EverLights controller and zone snapshots',
        'executor-gated light turn_on and turn_off commands through injected client.execute or commandExecutor',
      ],
      explicitUnsupported: [
        'claiming live command success without injected client.execute or commandExecutor',
        'calling the pyeverlights HTTP API directly without an injected native client or snapshotProvider',
        'cloud account flows and remote API polling',
      ],
    },
  },
};
