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

export const filesizeDomain = 'filesize';
export const filesizeDefaultName = 'File Size';

export type TFilesizeRawData = TSimpleLocalRawData;
export interface IFilesizeSnapshot extends ISimpleLocalSnapshot {}
export interface IFilesizeConfig extends ISimpleLocalConfig {
  filePath?: string;
  file_path?: string;
}
export interface IHomeAssistantFilesizeConfig extends IFilesizeConfig {}

export const filesizeProfile: ISimpleLocalIntegrationProfile = {
  domain: 'filesize',
  displayName: 'File Size',
  manufacturer: 'Home Assistant',
  model: 'Local File Statistics',
  defaultName: filesizeDefaultName,
  defaultProtocol: 'local',
  status: 'read-only-runtime',
  platforms: [
    'sensor',
  ],
  serviceDomains: [],
  controlServices: [],
  discoverySources: [
    'manual',
    'custom',
  ],
  discoveryKeywords: [
    'filesize',
    'file size',
    'local file',
    'stat',
    'bytes',
  ],
  metadata: {
    source: 'home-assistant/core',
    upstreamPath: 'homeassistant/components/filesize',
    upstreamDomain: 'filesize',
    iotClass: 'local_polling',
    qualityScale: undefined,
    requirements: [],
    dependencies: [],
    afterDependencies: [],
    codeowners: [
      '@gjohansson-ST',
    ],
    configFlow: true,
    runtime: {
      type: 'read-only-runtime',
      services: [
        'snapshot',
        'status',
        'refresh',
      ],
      platforms: [
        'sensor',
      ],
      controls: false,
    },
    localApi: {
      implemented: [
        'manual local file path setup, snapshots, raw data, snapshotProvider, and injected native clients',
        'read-only local file stat snapshots from config.filePath or config.file_path',
        'Home Assistant filesize size, bytes, last_updated, and created sensor mapping',
      ],
      explicitUnsupported: [
        'claiming live command success without injected client.execute or commandExecutor',
        'watch subscriptions and push updates without an injected native client',
        'Home Assistant allowlist enforcement outside caller-provided safe local paths',
      ],
    },
  },
};
