import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { FluxLedClient } from './flux_led.classes.client.js';
import { FluxLedConfigFlow } from './flux_led.classes.configflow.js';
import { createFluxLedDiscoveryDescriptor } from './flux_led.discovery.js';
import type { IFluxLedConfig } from './flux_led.types.js';
import { fluxLedDomain, fluxLedProfile } from './flux_led.types.js';

export class FluxLedIntegration extends SimpleLocalIntegration<IFluxLedConfig> {
  public readonly domain = fluxLedDomain;
  public readonly discoveryDescriptor = createFluxLedDiscoveryDescriptor();
  public readonly configFlow = new FluxLedConfigFlow();

  constructor() {
    super(fluxLedProfile);
  }

  public async setup(configArg: IFluxLedConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(fluxLedProfile, new FluxLedClient(configArg));
  }
}

export class HomeAssistantFluxLedIntegration extends FluxLedIntegration {}
