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

export const ekeybionyxDomain = 'ekeybionyx';
export const ekeybionyxDefaultName = 'ekey bionyx';

export type TEkeybionyxRawData = TSimpleLocalRawData;
export interface IEkeybionyxSnapshot extends ISimpleLocalSnapshot {}
export interface IEkeybionyxConfig extends ISimpleLocalConfig {}
export interface IHomeAssistantEkeybionyxConfig extends IEkeybionyxConfig {}

export const ekeybionyxProfile: ISimpleLocalIntegrationProfile = {
  domain: 'ekeybionyx',
  displayName: 'ekey bionyx',
  manufacturer: 'ekey',
  model: 'bionyx',
  defaultName: 'ekey bionyx',
  defaultProtocol: 'local',
  status: 'read-only-runtime',
  platforms: [
    'sensor',
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    'ekey',
    'bionyx',
    'fingerprint',
    'webhook',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/ekeybionyx',
    upstreamDomain: 'ekeybionyx',
    documentation: 'https://www.home-assistant.io/integrations/ekeybionyx',
    integrationType: 'hub',
    iotClass: 'local_push',
    qualityScale: 'bronze',
    requirements: [
      'ekey-bionyxpy==1.0.1',
    ],
    dependencies: [
      'application_credentials',
      'http',
    ],
    afterDependencies: [],
    codeowners: [
      '@richardpolzer',
    ],
    configFlow: true,
    homeAssistantPlatforms: [
      'event',
    ],
    oauth2: {
      authorizeUrl: 'https://ekeybionyxprod.b2clogin.com/ekeybionyxprod.onmicrosoft.com/B2C_1_sign_in_v2/oauth2/v2.0/authorize',
      tokenUrl: 'https://ekeybionyxprod.b2clogin.com/ekeybionyxprod.onmicrosoft.com/B2C_1_sign_in_v2/oauth2/v2.0/token',
      apiUrl: 'https://api.bionyx.io/3rd-party/api',
      scope: 'https://ekeybionyxprod.onmicrosoft.com/3rd-party-api/api-access',
    },
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'event',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local webhook/event endpoint setup',
        'snapshot, raw data, snapshotProvider, and injected native client operation',
        'local push event snapshots supplied through rawData, snapshot, snapshotProvider, or injected client',
      ],
      explicitUnsupported: [
        'claiming live command success without injected client.execute or commandExecutor',
        'OAuth2 cloud account provisioning or webhook creation without an injected client',
        'webhook HTTP server registration inside this SimpleLocal runtime',
      ],
    },
  },
};
