mirror of https://github.com/Hypfer/Valetudo.git
37 lines
856 B
JavaScript
37 lines
856 B
JavaScript
const SpeakerVolumeControlCapability = require("../../../core/capabilities/SpeakerVolumeControlCapability");
|
|
|
|
/**
|
|
* @extends SpeakerVolumeControlCapability<import("../MockRobot")>
|
|
*/
|
|
class MockSpeakerVolumeControlCapability extends SpeakerVolumeControlCapability {
|
|
/**
|
|
* @param {object} options
|
|
* @param {import("../MockRobot")} options.robot
|
|
*/
|
|
constructor(options) {
|
|
super(options);
|
|
this.volume = 80;
|
|
}
|
|
|
|
/**
|
|
* Returns the current voice volume as percentage
|
|
*
|
|
* @returns {Promise<number>}
|
|
*/
|
|
async getVolume() {
|
|
return this.volume;
|
|
}
|
|
|
|
/**
|
|
* Sets the speaker volume
|
|
*
|
|
* @param {number} value
|
|
* @returns {Promise<void>}
|
|
*/
|
|
async setVolume(value) {
|
|
this.volume = value;
|
|
}
|
|
}
|
|
|
|
module.exports = MockSpeakerVolumeControlCapability;
|