import { SimpleLocalIntegration, SimpleLocalRuntime, type IIntegrationRuntime, type IIntegrationSetupContext } from '../../core/index.js';
import { LocalTodoClient } from './local_todo.classes.client.js';
import { LocalTodoConfigFlow } from './local_todo.classes.configflow.js';
import { createLocalTodoDiscoveryDescriptor } from './local_todo.discovery.js';
import type { ILocalTodoConfig } from './local_todo.types.js';
import { localTodoDomain, localTodoProfile } from './local_todo.types.js';

export class LocalTodoIntegration extends SimpleLocalIntegration<ILocalTodoConfig> {
  public readonly domain = localTodoDomain;
  public readonly discoveryDescriptor = createLocalTodoDiscoveryDescriptor();
  public readonly configFlow = new LocalTodoConfigFlow();

  constructor() {
    super(localTodoProfile);
  }

  public async setup(configArg: ILocalTodoConfig, contextArg: IIntegrationSetupContext): Promise<IIntegrationRuntime> {
    void contextArg;
    return new SimpleLocalRuntime(localTodoProfile, new LocalTodoClient(configArg));
  }
}

export class HomeAssistantLocalTodoIntegration extends LocalTodoIntegration {}
