import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { PanasonicBlurayClient } from './panasonic_bluray.classes.client.js';
import { PanasonicBlurayConfigFlow } from './panasonic_bluray.classes.configflow.js';
import { createPanasonicBlurayDiscoveryDescriptor } from './panasonic_bluray.discovery.js';
import type { IPanasonicBlurayConfig } from './panasonic_bluray.types.js';
import { panasonicBlurayDomain, panasonicBlurayProfile } from './panasonic_bluray.types.js';

export class PanasonicBlurayIntegration extends SimpleLocalIntegration<IPanasonicBlurayConfig> {
  public readonly domain = panasonicBlurayDomain;
  public readonly discoveryDescriptor = createPanasonicBlurayDiscoveryDescriptor();
  public readonly configFlow = new PanasonicBlurayConfigFlow();

  constructor() {
    super(panasonicBlurayProfile);
  }

  public override async setup(configArg: IPanasonicBlurayConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(panasonicBlurayProfile, new PanasonicBlurayClient(configArg));
  }
}

export class HomeAssistantPanasonicBlurayIntegration extends PanasonicBlurayIntegration {}
