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