import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { MoehlenhoffAlpha2Client } from './moehlenhoff_alpha2.classes.client.js';
import { MoehlenhoffAlpha2ConfigFlow } from './moehlenhoff_alpha2.classes.configflow.js';
import { createMoehlenhoffAlpha2DiscoveryDescriptor } from './moehlenhoff_alpha2.discovery.js';
import type { IMoehlenhoffAlpha2Config } from './moehlenhoff_alpha2.types.js';
import { moehlenhoffAlpha2Domain, moehlenhoffAlpha2Profile } from './moehlenhoff_alpha2.types.js';

export class MoehlenhoffAlpha2Integration extends SimpleLocalIntegration<IMoehlenhoffAlpha2Config> {
  public readonly domain = moehlenhoffAlpha2Domain;
  public readonly discoveryDescriptor = createMoehlenhoffAlpha2DiscoveryDescriptor();
  public readonly configFlow = new MoehlenhoffAlpha2ConfigFlow();

  constructor() {
    super(moehlenhoffAlpha2Profile);
  }

  public async setup(configArg: IMoehlenhoffAlpha2Config, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(moehlenhoffAlpha2Profile, new MoehlenhoffAlpha2Client(configArg));
  }
}

export class HomeAssistantMoehlenhoffAlpha2Integration extends MoehlenhoffAlpha2Integration {}
