homebridge-soundtouch-plugins
Version:
Homebridge SoundTouch plugins
48 lines • 2.61 kB
JavaScript
;
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.SoundTouchLightbulbVolume = void 0;
var sound_touch_volume_1 = require("./sound-touch-volume");
var SoundTouchLightbulbVolume = /** @class */ (function (_super) {
__extends(SoundTouchLightbulbVolume, _super);
function SoundTouchLightbulbVolume() {
return _super !== null && _super.apply(this, arguments) || this;
}
SoundTouchLightbulbVolume.prototype.initService = function () {
var Service = this.accessoryWrapper.Service;
var Characteristic = this.accessoryWrapper.Characteristic;
var volumeService = this.accessoryWrapper.getService(Service.Lightbulb, this.accessoryWrapper.getDisplayName() + ' Volume', 'volumeService');
var brightnessCharacteristic = volumeService.getCharacteristic(Characteristic.Brightness);
if (brightnessCharacteristic === undefined)
volumeService.addCharacteristic(new Characteristic.Brightness());
return volumeService;
};
SoundTouchLightbulbVolume.clearServices = function (accessoryWrapper) {
accessoryWrapper.removeService(accessoryWrapper.Service.Lightbulb, 'volumeService');
};
SoundTouchLightbulbVolume.prototype.getVolumeCharacteristic = function () {
var Characteristic = this.accessoryWrapper.Characteristic;
return this.service.getCharacteristic(Characteristic.Brightness);
};
SoundTouchLightbulbVolume.prototype.getMuteCharacteristic = function () {
var Characteristic = this.accessoryWrapper.Characteristic;
return this.service.getCharacteristic(Characteristic.On);
};
return SoundTouchLightbulbVolume;
}(sound_touch_volume_1.SoundTouchVolume));
exports.SoundTouchLightbulbVolume = SoundTouchLightbulbVolume;
//# sourceMappingURL=sound-touch-lightbulb-volume.js.map