import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { HdfuryClient } from './hdfury.classes.client.js';
import { HdfuryConfigFlow } from './hdfury.classes.configflow.js';
import { createHdfuryDiscoveryDescriptor } from './hdfury.discovery.js';
import type { IHdfuryConfig } from './hdfury.types.js';
import { hdfuryDomain, hdfuryProfile } from './hdfury.types.js';

export class HdfuryIntegration extends SimpleLocalIntegration<IHdfuryConfig> {
  public readonly domain = hdfuryDomain;
  public readonly discoveryDescriptor = createHdfuryDiscoveryDescriptor();
  public readonly configFlow = new HdfuryConfigFlow();

  constructor() {
    super(hdfuryProfile);
  }

  public async setup(configArg: IHdfuryConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(hdfuryProfile, new HdfuryClient(configArg));
  }
}

export class HomeAssistantHdfuryIntegration extends HdfuryIntegration {}
