import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { PanasonicVieraClient } from './panasonic_viera.classes.client.js';
import { PanasonicVieraConfigFlow } from './panasonic_viera.classes.configflow.js';
import { createPanasonicVieraDiscoveryDescriptor } from './panasonic_viera.discovery.js';
import type { IPanasonicVieraConfig } from './panasonic_viera.types.js';
import { panasonicVieraDomain, panasonicVieraProfile } from './panasonic_viera.types.js';

export class PanasonicVieraIntegration extends SimpleLocalIntegration<IPanasonicVieraConfig> {
  public readonly domain = panasonicVieraDomain;
  public readonly discoveryDescriptor = createPanasonicVieraDiscoveryDescriptor();
  public readonly configFlow = new PanasonicVieraConfigFlow();

  constructor() {
    super(panasonicVieraProfile);
  }

  public async setup(configArg: IPanasonicVieraConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(panasonicVieraProfile, new PanasonicVieraClient(configArg));
  }
}

export class HomeAssistantPanasonicVieraIntegration extends PanasonicVieraIntegration {}
