export * from './core/index.js';
export * from './protocols/index.js';
export * from './integrations/index.js';

import { HueIntegration } from './integrations/hue/index.js';
import { AndroidtvIntegration } from './integrations/androidtv/index.js';
import { CastIntegration } from './integrations/cast/index.js';
import { DeconzIntegration } from './integrations/deconz/index.js';
import { DenonavrIntegration } from './integrations/denonavr/index.js';
import { EsphomeIntegration } from './integrations/esphome/index.js';
import { HomekitControllerIntegration } from './integrations/homekit_controller/index.js';
import { KodiIntegration } from './integrations/kodi/index.js';
import { MatterIntegration } from './integrations/matter/index.js';
import { MqttIntegration } from './integrations/mqtt/index.js';
import { NanoleafIntegration } from './integrations/nanoleaf/index.js';
import { RokuIntegration } from './integrations/roku/index.js';
import { SamsungtvIntegration } from './integrations/samsungtv/index.js';
import { ShellyIntegration } from './integrations/shelly/index.js';
import { SonosIntegration } from './integrations/sonos/index.js';
import { TplinkIntegration } from './integrations/tplink/index.js';
import { TradfriIntegration } from './integrations/tradfri/index.js';
import { UnifiIntegration } from './integrations/unifi/index.js';
import { WolfSmartsetIntegration } from './integrations/wolf_smartset/index.js';
import { WizIntegration } from './integrations/wiz/index.js';
import { XiaomiMiioIntegration } from './integrations/xiaomi_miio/index.js';
import { YeelightIntegration } from './integrations/yeelight/index.js';
import { ZhaIntegration } from './integrations/zha/index.js';
import { ZwaveJsIntegration } from './integrations/zwave_js/index.js';
import { generatedHomeAssistantPortIntegrations } from './integrations/generated/index.js';
import { IntegrationRegistry } from './core/index.js';

export const integrations = [
  new AndroidtvIntegration(),
  new CastIntegration(),
  new DeconzIntegration(),
  new DenonavrIntegration(),
  new EsphomeIntegration(),
  new HomekitControllerIntegration(),
  new HueIntegration(),
  new KodiIntegration(),
  new MatterIntegration(),
  new MqttIntegration(),
  new NanoleafIntegration(),
  new RokuIntegration(),
  new SamsungtvIntegration(),
  new ShellyIntegration(),
  new SonosIntegration(),
  new TplinkIntegration(),
  new TradfriIntegration(),
  new UnifiIntegration(),
  new WolfSmartsetIntegration(),
  new WizIntegration(),
  new XiaomiMiioIntegration(),
  new YeelightIntegration(),
  new ZhaIntegration(),
  new ZwaveJsIntegration(),
];

export const createDefaultIntegrationRegistry = (): IntegrationRegistry => {
  const registry = new IntegrationRegistry();
  for (const integration of integrations) {
    registry.register(integration);
  }
  for (const integration of generatedHomeAssistantPortIntegrations) {
    if (!registry.get(integration.domain)) {
      registry.register(integration);
    }
  }
  return registry;
};
