import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { GoveeLightLocalClient } from './govee_light_local.classes.client.js';
import { GoveeLightLocalConfigFlow } from './govee_light_local.classes.configflow.js';
import { createGoveeLightLocalDiscoveryDescriptor } from './govee_light_local.discovery.js';
import type { IGoveeLightLocalConfig } from './govee_light_local.types.js';
import { goveeLightLocalDomain, goveeLightLocalProfile } from './govee_light_local.types.js';

export class GoveeLightLocalIntegration extends SimpleLocalIntegration<IGoveeLightLocalConfig> {
  public readonly domain = goveeLightLocalDomain;
  public readonly discoveryDescriptor = createGoveeLightLocalDiscoveryDescriptor();
  public readonly configFlow = new GoveeLightLocalConfigFlow();

  constructor() {
    super(goveeLightLocalProfile);
  }

  public async setup(configArg: IGoveeLightLocalConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(goveeLightLocalProfile, new GoveeLightLocalClient(configArg));
  }
}

export class HomeAssistantGoveeLightLocalIntegration extends GoveeLightLocalIntegration {}
