import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { JvcProjectorClient } from './jvc_projector.classes.client.js';
import { JvcProjectorConfigFlow } from './jvc_projector.classes.configflow.js';
import { createJvcProjectorDiscoveryDescriptor } from './jvc_projector.discovery.js';
import type { IJvcProjectorConfig } from './jvc_projector.types.js';
import { jvcProjectorDomain, jvcProjectorProfile } from './jvc_projector.types.js';

export class JvcProjectorIntegration extends SimpleLocalIntegration<IJvcProjectorConfig> {
  public readonly domain = jvcProjectorDomain;
  public readonly discoveryDescriptor = createJvcProjectorDiscoveryDescriptor();
  public readonly configFlow = new JvcProjectorConfigFlow();

  constructor() {
    super(jvcProjectorProfile);
  }

  public async setup(configArg: IJvcProjectorConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(jvcProjectorProfile, new JvcProjectorClient(configArg));
  }
}

export class HomeAssistantJvcProjectorIntegration extends JvcProjectorIntegration {}
