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

import { HueIntegration } from './integrations/hue/index.js';
import { AdguardIntegration } from './integrations/adguard/index.js';
import { AirgradientIntegration } from './integrations/airgradient/index.js';
import { AmcrestIntegration } from './integrations/amcrest/index.js';
import { AndroidIpWebcamIntegration } from './integrations/android_ip_webcam/index.js';
import { AndroidtvIntegration } from './integrations/androidtv/index.js';
import { AndroidtvRemoteIntegration } from './integrations/androidtv_remote/index.js';
import { AxisIntegration } from './integrations/axis/index.js';
import { ApcupsdIntegration } from './integrations/apcupsd/index.js';
import { ArcamFmjIntegration } from './integrations/arcam_fmj/index.js';
import { AsuswrtIntegration } from './integrations/asuswrt/index.js';
import { BleboxIntegration } from './integrations/blebox/index.js';
import { BluetoothLeTrackerIntegration } from './integrations/bluetooth_le_tracker/index.js';
import { BoschShcIntegration } from './integrations/bosch_shc/index.js';
import { BraviatvIntegration } from './integrations/braviatv/index.js';
import { BroadlinkIntegration } from './integrations/broadlink/index.js';
import { CastIntegration } from './integrations/cast/index.js';
import { DeconzIntegration } from './integrations/deconz/index.js';
import { DenonavrIntegration } from './integrations/denonavr/index.js';
import { DevoloHomeNetworkIntegration } from './integrations/devolo_home_network/index.js';
import { DlnaDmrIntegration } from './integrations/dlna_dmr/index.js';
import { DsmrIntegration } from './integrations/dsmr/index.js';
import { EsphomeIntegration } from './integrations/esphome/index.js';
import { FritzIntegration } from './integrations/fritz/index.js';
import { GlancesIntegration } from './integrations/glances/index.js';
import { HeosIntegration } from './integrations/heos/index.js';
import { HomekitControllerIntegration } from './integrations/homekit_controller/index.js';
import { HomematicIntegration } from './integrations/homematic/index.js';
import { IppIntegration } from './integrations/ipp/index.js';
import { JellyfinIntegration } from './integrations/jellyfin/index.js';
import { KnxIntegration } from './integrations/knx/index.js';
import { KodiIntegration } from './integrations/kodi/index.js';
import { MatterIntegration } from './integrations/matter/index.js';
import { MikrotikIntegration } from './integrations/mikrotik/index.js';
import { ModbusIntegration } from './integrations/modbus/index.js';
import { MotionEyeIntegration } from './integrations/motioneye/index.js';
import { MqttIntegration } from './integrations/mqtt/index.js';
import { MpdIntegration } from './integrations/mpd/index.js';
import { NanoleafIntegration } from './integrations/nanoleaf/index.js';
import { OpenthermGwIntegration } from './integrations/opentherm_gw/index.js';
import { OpnsenseIntegration } from './integrations/opnsense/index.js';
import { OnvifIntegration } from './integrations/onvif/index.js';
import { PiHoleIntegration } from './integrations/pi_hole/index.js';
import { PlexIntegration } from './integrations/plex/index.js';
import { RainbirdIntegration } from './integrations/rainbird/index.js';
import { RflinkIntegration } from './integrations/rflink/index.js';
import { RokuIntegration } from './integrations/roku/index.js';
import { SamsungtvIntegration } from './integrations/samsungtv/index.js';
import { ShellyIntegration } from './integrations/shelly/index.js';
import { SnapcastIntegration } from './integrations/snapcast/index.js';
import { SonosIntegration } from './integrations/sonos/index.js';
import { SqueezeboxIntegration } from './integrations/squeezebox/index.js';
import { SynologyDsmIntegration } from './integrations/synology_dsm/index.js';
import { TplinkIntegration } from './integrations/tplink/index.js';
import { TradfriIntegration } from './integrations/tradfri/index.js';
import { UnifiIntegration } from './integrations/unifi/index.js';
import { VelbusIntegration } from './integrations/velbus/index.js';
import { VolumioIntegration } from './integrations/volumio/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 { YamahaMusiccastIntegration } from './integrations/yamaha_musiccast/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 AdguardIntegration(),
  new AirgradientIntegration(),
  new AmcrestIntegration(),
  new AndroidIpWebcamIntegration(),
  new AndroidtvIntegration(),
  new AndroidtvRemoteIntegration(),
  new ApcupsdIntegration(),
  new ArcamFmjIntegration(),
  new AsuswrtIntegration(),
  new AxisIntegration(),
  new BleboxIntegration(),
  new BluetoothLeTrackerIntegration(),
  new BoschShcIntegration(),
  new BraviatvIntegration(),
  new BroadlinkIntegration(),
  new CastIntegration(),
  new DeconzIntegration(),
  new DenonavrIntegration(),
  new DevoloHomeNetworkIntegration(),
  new DlnaDmrIntegration(),
  new DsmrIntegration(),
  new EsphomeIntegration(),
  new FritzIntegration(),
  new GlancesIntegration(),
  new HeosIntegration(),
  new HomekitControllerIntegration(),
  new HomematicIntegration(),
  new HueIntegration(),
  new IppIntegration(),
  new JellyfinIntegration(),
  new KnxIntegration(),
  new KodiIntegration(),
  new MatterIntegration(),
  new MikrotikIntegration(),
  new ModbusIntegration(),
  new MotionEyeIntegration(),
  new MqttIntegration(),
  new MpdIntegration(),
  new NanoleafIntegration(),
  new OpenthermGwIntegration(),
  new OpnsenseIntegration(),
  new OnvifIntegration(),
  new PiHoleIntegration(),
  new PlexIntegration(),
  new RainbirdIntegration(),
  new RflinkIntegration(),
  new RokuIntegration(),
  new SamsungtvIntegration(),
  new ShellyIntegration(),
  new SnapcastIntegration(),
  new SonosIntegration(),
  new SqueezeboxIntegration(),
  new SynologyDsmIntegration(),
  new TplinkIntegration(),
  new TradfriIntegration(),
  new UnifiIntegration(),
  new VelbusIntegration(),
  new VolumioIntegration(),
  new WolfSmartsetIntegration(),
  new WizIntegration(),
  new XiaomiMiioIntegration(),
  new YeelightIntegration(),
  new YamahaMusiccastIntegration(),
  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;
};
