import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { LandisgyrHeatMeterClient } from './landisgyr_heat_meter.classes.client.js';
import { LandisgyrHeatMeterConfigFlow } from './landisgyr_heat_meter.classes.configflow.js';
import { createLandisgyrHeatMeterDiscoveryDescriptor } from './landisgyr_heat_meter.discovery.js';
import type { ILandisgyrHeatMeterConfig } from './landisgyr_heat_meter.types.js';
import { landisgyrHeatMeterDomain, landisgyrHeatMeterProfile } from './landisgyr_heat_meter.types.js';

export class LandisgyrHeatMeterIntegration extends SimpleLocalIntegration<ILandisgyrHeatMeterConfig> {
  public readonly domain = landisgyrHeatMeterDomain;
  public readonly discoveryDescriptor = createLandisgyrHeatMeterDiscoveryDescriptor();
  public readonly configFlow = new LandisgyrHeatMeterConfigFlow();

  constructor() {
    super(landisgyrHeatMeterProfile);
  }

  public async setup(configArg: ILandisgyrHeatMeterConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(landisgyrHeatMeterProfile, new LandisgyrHeatMeterClient(configArg));
  }
}
