import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { HlkSw16Client } from './hlk_sw16.classes.client.js';
import { HlkSw16ConfigFlow } from './hlk_sw16.classes.configflow.js';
import { createHlkSw16DiscoveryDescriptor } from './hlk_sw16.discovery.js';
import type { IHlkSw16Config } from './hlk_sw16.types.js';
import { hlkSw16Domain, hlkSw16Profile } from './hlk_sw16.types.js';

export class HlkSw16Integration extends SimpleLocalIntegration<IHlkSw16Config> {
  public readonly domain = hlkSw16Domain;
  public readonly discoveryDescriptor = createHlkSw16DiscoveryDescriptor();
  public readonly configFlow = new HlkSw16ConfigFlow();

  constructor() {
    super(hlkSw16Profile);
  }

  public async setup(configArg: IHlkSw16Config, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(hlkSw16Profile, new HlkSw16Client(configArg));
  }
}

export class HomeAssistantHlkSw16Integration extends HlkSw16Integration {}
