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

export const holidayDomain = 'holiday';
export const holidayDefaultName = 'Holiday';

export type THolidayRawData = TSimpleLocalRawData;
export interface IHolidaySnapshot extends ISimpleLocalSnapshot {}
export interface IHolidayConfig extends ISimpleLocalConfig {
  country?: string;
  province?: string;
  categories?: string[];
  language?: string;
}
export interface IHomeAssistantHolidayConfig extends IHolidayConfig {}

export const holidayProfile: ISimpleLocalIntegrationProfile = {
  domain: 'holiday',
  displayName: 'Holiday',
  manufacturer: 'Home Assistant',
  model: 'Holiday Calendar',
  defaultName: holidayDefaultName,
  defaultProtocol: 'local',
  status: 'read-only-runtime',
  platforms: [
    'binary_sensor',
    'sensor',
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    'holiday',
    'calendar',
    'holidays',
    'country holidays',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/holiday',
    upstreamDomain: 'holiday',
    iotClass: 'local_polling',
    qualityScale: undefined,
    requirements: [
      'holidays==0.95',
      'babel==2.15.0',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      '@jrieger',
      '@gjohansson-ST',
    ],
    configFlow: true,
    documentation: 'https://www.home-assistant.io/integrations/holiday',
    platforms: [
      'calendar',
    ],
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'calendar',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local setup for country/province/category metadata, snapshots, raw holiday event data, snapshotProvider, and injected native clients',
        'runtime mapping of holiday event snapshots to next-holiday and holiday-today entities',
      ],
      explicitUnsupported: [
        'computing country holidays from the Python holidays and Babel packages in this TypeScript package',
        'Home Assistant calendar entity event querying without an injected client or snapshotProvider',
        'claiming calendar write or control success without an injected client.execute or commandExecutor',
      ],
    },
  },
};
