UNPKG

homebridge-cozytouch-platform

Version:
54 lines (53 loc) 3.49 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.WaterheatingAccessoryWrapper = exports.WaterHeatingState = void 0; var homebridge_base_platform_1 = require("homebridge-base-platform"); var cozytouch_accessory_wrapper_1 = require("../cozytouch-accessory-wrapper"); var WaterHeatingState; (function (WaterHeatingState) { WaterHeatingState["softwareVersion"] = "core:DHWPSoftwareVersionState"; })(WaterHeatingState = exports.WaterHeatingState || (exports.WaterHeatingState = {})); var WaterheatingAccessoryWrapper = /** @class */ (function (_super) { __extends(WaterheatingAccessoryWrapper, _super); function WaterheatingAccessoryWrapper(context, accessory, device) { var _this = _super.call(this, context, accessory, device) || this; _this.thermostatService = _this.initThermostatService(); return _this; } WaterheatingAccessoryWrapper.prototype.initThermostatService = function () { var thermostatService = this.getService(this.Service.Thermostat, this.getDisplayName(), 'thermostatService'); this.currentHeatingCharacteristic = thermostatService.getCharacteristic(this.Characteristic.CurrentHeatingCoolingState); this.currentHeatingCharacteristic.on('get', (0, homebridge_base_platform_1.callbackify)(this.getCurrentHeatingState.bind(this))); this.targetHeatingCharacteristic = thermostatService.getCharacteristic(this.Characteristic.TargetHeatingCoolingState); this.targetHeatingCharacteristic .on('get', (0, homebridge_base_platform_1.callbackify)(this.getTargetHeatingState.bind(this))) .on('set', (0, homebridge_base_platform_1.callbackify)(this.setTargetHeatingState.bind(this))); this.currentTemperatureCharacteristic = thermostatService.getCharacteristic(this.Characteristic.CurrentTemperature); this.currentTemperatureCharacteristic .on('get', (0, homebridge_base_platform_1.callbackify)(this.getCurrentTemperature.bind(this))); this.targetTemperatureCharacteristic = thermostatService.getCharacteristic(this.Characteristic.TargetTemperature); this.targetTemperatureCharacteristic .on('get', (0, homebridge_base_platform_1.callbackify)(this.getTargetTemperature.bind(this))) .on('set', (0, homebridge_base_platform_1.callbackify)(this.setTargetTemperature.bind(this))); }; WaterheatingAccessoryWrapper.prototype.getSoftwareVersion = function () { return this.object.getStateValue(WaterHeatingState.softwareVersion); }; return WaterheatingAccessoryWrapper; }(cozytouch_accessory_wrapper_1.CozytouchAccessoryWrapper)); exports.WaterheatingAccessoryWrapper = WaterheatingAccessoryWrapper;