import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { EmulatedRokuClient } from './emulated_roku.classes.client.js';
import { EmulatedRokuConfigFlow } from './emulated_roku.classes.configflow.js';
import { createEmulatedRokuDiscoveryDescriptor } from './emulated_roku.discovery.js';
import type { IEmulatedRokuConfig } from './emulated_roku.types.js';
import { emulatedRokuDomain, emulatedRokuProfile } from './emulated_roku.types.js';

export class EmulatedRokuIntegration extends SimpleLocalIntegration<IEmulatedRokuConfig> {
  public readonly domain = emulatedRokuDomain;
  public readonly discoveryDescriptor = createEmulatedRokuDiscoveryDescriptor();
  public readonly configFlow = new EmulatedRokuConfigFlow();

  constructor() {
    super(emulatedRokuProfile);
  }

  public async setup(configArg: IEmulatedRokuConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(emulatedRokuProfile, new EmulatedRokuClient(configArg));
  }
}

export class HomeAssistantEmulatedRokuIntegration extends EmulatedRokuIntegration {}
