UNPKG

homebridge-rinnai-touch-platform

Version:

Homebridge Plugin to control heating/cooling via a Rinnai Touch WiFi Module

119 lines 4.53 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Settings = void 0; class Settings { constructor(config) { var _a, _b, _c, _d, _e, _f, _g, _h, _j; this.config = config; if (config.mqtt) { const mqtt = config.mqtt; this._mqtt = { host: mqtt.host, port: (_a = mqtt.port) !== null && _a !== void 0 ? _a : 1883, username: mqtt.username, password: mqtt.password, topicPrefix: mqtt.topicPrefix, formatHomeAssistant: (_b = mqtt.formatHomeAssistant) !== null && _b !== void 0 ? _b : false, formatConnection: (_c = mqtt.formatConnection) !== null && _c !== void 0 ? _c : false, formatFault: (_d = mqtt.formatFault) !== null && _d !== void 0 ? _d : false, publishStatusChanged: (_e = mqtt.publishStatusChanged) !== null && _e !== void 0 ? _e : false, publishIntervals: (_f = mqtt.publishIntervals) !== null && _f !== void 0 ? _f : false, publishFrequency: (_g = mqtt.publishFrequency) !== null && _g !== void 0 ? _g : 60, publishAll: (_h = mqtt.publishAll) !== null && _h !== void 0 ? _h : false, showMqttEvents: (_j = mqtt.showMqttEvents) !== null && _j !== void 0 ? _j : true, subscribeTemperature: mqtt.subscribeTemperature, }; } } // Getters get name() { var _a; return (_a = this.config.name) !== null && _a !== void 0 ? _a : 'Rinnai Touch'; } get address() { return this.config.address; } get port() { return this.config.port; } get controllerType() { var _a, _b; const controllerType = (_b = (_a = this.config.controllerType) === null || _a === void 0 ? void 0 : _a.substring(0, 1).toUpperCase()) !== null && _b !== void 0 ? _b : 'T'; return ['T', 'H'].includes(controllerType) ? controllerType : 'T'; } get zoneType() { var _a, _b; const zoneType = (_b = (_a = this.config.zoneType) === null || _a === void 0 ? void 0 : _a.substring(0, 1).toUpperCase()) !== null && _b !== void 0 ? _b : 'S'; return ['N', 'S', 'H'].includes(zoneType) ? zoneType : 'S'; } get showFan() { var _a; return (_a = this.config.showFan) !== null && _a !== void 0 ? _a : true; } get showAuto() { var _a; return (_a = this.config.showAuto) !== null && _a !== void 0 ? _a : true; } get showAdvanceSwitches() { var _a; return (_a = this.config.showAdvanceSwitches) !== null && _a !== void 0 ? _a : true; } get showManualSwitches() { var _a; return (_a = this.config.showManualSwitches) !== null && _a !== void 0 ? _a : true; } get seperateModeAccessories() { var _a; return (_a = this.config.seperateModeAccessories) !== null && _a !== void 0 ? _a : false; } get seperateFanZoneSwitches() { var _a; return (_a = this.config.seperateFanZoneSwitches) !== null && _a !== void 0 ? _a : false; } get invertComfortLevel() { var _a; return (_a = this.config.invertComfortLevel) !== null && _a !== void 0 ? _a : true; } get setAutoOperatingState() { var _a; return (_a = this.config.setAutoOperatingState) !== null && _a !== void 0 ? _a : true; } get showHomebridgeEvents() { var _a; return (_a = this.config.showHomebridgeEvents) !== null && _a !== void 0 ? _a : true; } get showModuleEvents() { var _a; return (_a = this.config.showModuleEvents) !== null && _a !== void 0 ? _a : true; } get showModuleStatus() { var _a; return (_a = this.config.showModuleStatus) !== null && _a !== void 0 ? _a : false; } get clearCache() { var _a; return (_a = this.config.clearCache) !== null && _a !== void 0 ? _a : false; } get forceAutoDiscovery() { var _a; return (_a = this.config.forceAutoDiscovery) !== null && _a !== void 0 ? _a : false; } get bootTime() { return this.config.bootTime; } get bootPassword() { return this.config.bootPassword; } get mqtt() { return this._mqtt; } get pushover() { return this.config.pushover; } } exports.Settings = Settings; //# sourceMappingURL=Settings.js.map