Weather Station / ECOWITT / DNT
0

Configure Feed

Select the types of activity you want to include in your feed.

at stats2.0 836 B View raw
1// Demo EcoCon configuration. 2// Copy this file to `eco.ts` and fill in your Ecowitt API credentials. 3// IMPORTANT: Do NOT commit your real keys. The repo's .gitignore excludes `eco.ts`. 4// Docs: https://doc.ecowitt.net/web/#/apiv3en?page_id=17 5 6class EcoCon { 7 private static instance: EcoCon; 8 9 private readonly config = { 10 applicationKey: "YOUR_APPLICATION_KEY_HERE", 11 apiKey: "YOUR_API_KEY_HERE", 12 mac: "AA:BB:CC:DD:EE:FF", 13 server: "api.ecowitt.net" 14 }; 15 16 private constructor() {} 17 18 public static getInstance(): EcoCon { 19 if (!EcoCon.instance) { 20 EcoCon.instance = new EcoCon(); 21 } 22 return EcoCon.instance; 23 } 24 25 public setServer(server: string): void { 26 this.config.server = server; 27 } 28 29 public getConfig(): Readonly<typeof this.config> { 30 return this.config; 31 } 32} 33 34export default EcoCon;