homebridge-bondbridge
Version:
Plugin to integrate BondBridge units by Bond to Homekit
17 lines (13 loc) • 401 B
JavaScript
const fs = require("fs");
const path = require("path");
function readConfig( storagePath, log ) {
const filePath = path.join(storagePath, ".bondbridge", "config.json");
if (fs.existsSync(filePath)) {
const data = fs.readFileSync(filePath, "utf8");
return JSON.parse(data);
} else {
log.warn(`⚠️ ${filePath} not found`);
return null;
}
}
module.exports = { readConfig };