import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { Isy994Client } from './isy994.classes.client.js';
import { Isy994ConfigFlow } from './isy994.classes.configflow.js';
import { createIsy994DiscoveryDescriptor } from './isy994.discovery.js';
import type { IIsy994Config } from './isy994.types.js';
import { isy994Domain, isy994Profile } from './isy994.types.js';

export class Isy994Integration extends SimpleLocalIntegration<IIsy994Config> {
  public readonly domain = isy994Domain;
  public readonly discoveryDescriptor = createIsy994DiscoveryDescriptor();
  public readonly configFlow = new Isy994ConfigFlow();

  constructor() {
    super(isy994Profile);
  }

  public async setup(configArg: IIsy994Config, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(isy994Profile, new Isy994Client(configArg));
  }
}

export class HomeAssistantIsy994Integration extends Isy994Integration {}
