import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { LinksysSmartClient } from './linksys_smart.classes.client.js';
import { LinksysSmartConfigFlow } from './linksys_smart.classes.configflow.js';
import { createLinksysSmartDiscoveryDescriptor } from './linksys_smart.discovery.js';
import type { ILinksysSmartConfig } from './linksys_smart.types.js';
import { linksysSmartDomain, linksysSmartProfile } from './linksys_smart.types.js';

export class LinksysSmartIntegration extends SimpleLocalIntegration<ILinksysSmartConfig> {
  public readonly domain = linksysSmartDomain;
  public readonly discoveryDescriptor = createLinksysSmartDiscoveryDescriptor();
  public readonly configFlow = new LinksysSmartConfigFlow();

  constructor() {
    super(linksysSmartProfile);
  }

  public override async setup(configArg: ILinksysSmartConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(linksysSmartProfile, new LinksysSmartClient(configArg));
  }
}

export class HomeAssistantLinksysSmartIntegration extends LinksysSmartIntegration {}
