homebridge-rinnai-touch-platform
Version:
Homebridge Plugin to control heating/cooling via a Rinnai Touch WiFi Module
49 lines • 1.66 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Fault = void 0;
const Status_1 = require("./Status");
class Fault {
constructor(status) {
this._detected = status.getState(Status_1.States.FaultDetected) === 'Y';
switch (status.getState(Status_1.States.FaultApplianceType)) {
case 'H':
this._applicanceType = 'Heater';
break;
case 'C':
this._applicanceType = 'Add-On Cooler';
break;
case 'E':
this._applicanceType = 'Evaporative Cooler';
break;
case 'R':
this._applicanceType = 'Reverse Cycle';
break;
case 'N':
this._applicanceType = 'Controlling Device';
break;
}
this._unit = status.getState(Status_1.States.FaultUnit);
switch (status.getState(Status_1.States.FaultSeverity)) {
case 'M':
this._severity = 'Minor';
break;
case 'B':
this._severity = 'Busy';
break;
case 'L':
this._severity = 'Lockout';
break;
}
this._code = status.getState(Status_1.States.FaultCode);
}
get detected() {
return this._detected;
}
toString() {
return this._detected
? `Fault in ${this._applicanceType} detected [Unit: ${this._unit}, Severity: ${this._severity}, Code: ${this._code}]`
: 'No fault detected';
}
}
exports.Fault = Fault;
//# sourceMappingURL=Fault.js.map