import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { HolidayClient } from './holiday.classes.client.js';
import { HolidayConfigFlow } from './holiday.classes.configflow.js';
import { createHolidayDiscoveryDescriptor } from './holiday.discovery.js';
import type { IHolidayConfig } from './holiday.types.js';
import { holidayDomain, holidayProfile } from './holiday.types.js';

export class HolidayIntegration extends SimpleLocalIntegration<IHolidayConfig> {
  public readonly domain = holidayDomain;
  public readonly discoveryDescriptor = createHolidayDiscoveryDescriptor();
  public readonly configFlow = new HolidayConfigFlow();

  constructor() {
    super(holidayProfile);
  }

  public async setup(configArg: IHolidayConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(holidayProfile, new HolidayClient(configArg));
  }
}

export class HomeAssistantHolidayIntegration extends HolidayIntegration {}
