import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { NfandroidtvClient } from './nfandroidtv.classes.client.js';
import { NfandroidtvConfigFlow } from './nfandroidtv.classes.configflow.js';
import { createNfandroidtvDiscoveryDescriptor } from './nfandroidtv.discovery.js';
import type { INfandroidtvConfig } from './nfandroidtv.types.js';
import { nfandroidtvDomain, nfandroidtvProfile } from './nfandroidtv.types.js';

export class NfandroidtvIntegration extends SimpleLocalIntegration<INfandroidtvConfig> {
  public readonly domain = nfandroidtvDomain;
  public readonly discoveryDescriptor = createNfandroidtvDiscoveryDescriptor();
  public readonly configFlow = new NfandroidtvConfigFlow();

  constructor() {
    super(nfandroidtvProfile);
  }

  public override async setup(configArg: INfandroidtvConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(nfandroidtvProfile, new NfandroidtvClient(configArg));
  }
}

export class HomeAssistantNfandroidtvIntegration extends NfandroidtvIntegration {}
