import type { ISimpleLocalConfig, ISimpleLocalIntegrationProfile, ISimpleLocalSnapshot, TSimpleLocalRawData } from '../../core/index.js';

export const fibaroDomain = 'fibaro';
export const fibaroDefaultName = 'Fibaro Home Center';

export type TFibaroRawData = TSimpleLocalRawData;
export interface IFibaroSnapshot extends ISimpleLocalSnapshot {}
export interface IFibaroConfig extends ISimpleLocalConfig {
  url?: string;
  importPlugins?: boolean;
  import_plugins?: boolean;
}
export interface IHomeAssistantFibaroConfig extends IFibaroConfig {}

export const fibaroProfile: ISimpleLocalIntegrationProfile = {
  domain: 'fibaro',
  displayName: 'Fibaro',
  manufacturer: 'Fibaro',
  model: 'Home Center',
  defaultName: fibaroDefaultName,
  defaultHttpPath: '/api/',
  defaultProtocol: 'http',
  status: 'read-only-runtime',
  platforms: [
    'binary_sensor',
    'button',
    'climate',
    'cover',
    'light',
    'sensor',
    'switch',
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'http',
    'custom',
  ],
  discoveryKeywords: [
    'fibaro',
    'home center',
    'home center lite',
    'hc2',
    'hc3',
    'z-wave',
    'zwave',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/fibaro',
    upstreamDomain: 'fibaro',
    integrationType: 'hub',
    iotClass: 'local_push',
    qualityScale: undefined,
    requirements: [
      'pyfibaro==0.8.3',
    ],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      '@rappenze',
    ],
    configFlow: true,
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'binary_sensor',
        'climate',
        'cover',
        'event',
        'light',
        'lock',
        'scene',
        'sensor',
        'switch',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local Fibaro URL/API setup, snapshots, raw data, snapshotProvider, and injected native clients',
        'Fibaro hub info, devices, power/energy attributes, and scenes snapshot mapping',
      ],
      explicitUnsupported: [
        'opening a live Fibaro push connection without an injected client or snapshotProvider',
        'claiming live device, lock, cover, climate, light, switch, or scene command success without injected client.execute or commandExecutor',
        'Fibaro plugin import side effects without a real Fibaro client',
      ],
    },
  },
};
