import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { GoogleWifiClient } from './google_wifi.classes.client.js';
import { GoogleWifiConfigFlow } from './google_wifi.classes.configflow.js';
import { createGoogleWifiDiscoveryDescriptor } from './google_wifi.discovery.js';
import type { IGoogleWifiConfig } from './google_wifi.types.js';
import { googleWifiDomain, googleWifiProfile } from './google_wifi.types.js';

export class GoogleWifiIntegration extends SimpleLocalIntegration<IGoogleWifiConfig> {
  public readonly domain = googleWifiDomain;
  public readonly discoveryDescriptor = createGoogleWifiDiscoveryDescriptor();
  public readonly configFlow = new GoogleWifiConfigFlow();

  constructor() {
    super(googleWifiProfile);
  }

  public async setup(configArg: IGoogleWifiConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(googleWifiProfile, new GoogleWifiClient(configArg));
  }
}

export class HomeAssistantGoogleWifiIntegration extends GoogleWifiIntegration {}
