import * as crypto from 'crypto'; import { DaikinBRP069 } from './brp069.js'; import { HttpClient } from '../http.js'; export interface BRP072COptions { key: string; uuid?: string; } export class DaikinBRP072C extends DaikinBRP069 { private key: string; private uuid: string; constructor(deviceId: string, options: BRP072COptions) { super(deviceId, false); this.key = options.key; this.uuid = options.uuid || this.generateUuid(); this.baseUrl = `https://${this.deviceIp}`; this.headers = { 'X-Daikin-uuid': this.uuid }; this.httpClient = new HttpClient(this.baseUrl, 30000, {}, false); } private generateUuid(): string { const namespace = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; const name = 'pydaikin'; const hash = crypto.createHash('md5').update(namespace + name).digest('hex'); return hash.replace(/-/g, ''); } async init(): Promise { await this.getResource('common/register_terminal', { key: this.key }); await super.init(); } }