Skip to content

Commit

Permalink
Merge pull request #14 from SimonSickle/master
Browse files Browse the repository at this point in the history
Add getters for the volume commands
  • Loading branch information
heathbar authored Sep 27, 2018
2 parents 45519c7 + 72b0121 commit 0f7948a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ let SMARTCAST = function smartcast(host, authKey) {
up: () => {
return this.control.keyCommand(5, 1);
},
get: () => {
return new Promise((resolve) => {
sendRequest('get', host + '/menu_native/dynamic/tv_settings/audio/volume', _authKey).then(resolve)
});
},
set: (value) => {
return new Promise((resolve, reject) => {
if (typeof value !== 'number') {
Expand All @@ -217,6 +222,11 @@ let SMARTCAST = function smartcast(host, authKey) {
}).catch(reject);
});
},
getMuteState: () => {
return new Promise((resolve) => {
sendRequest('get', host + '/menu_native/dynamic/tv_settings/audio/mute', _authKey).then(resolve)
});
},
unmute: () => {
return this.control.keyCommand(5, 2);
},
Expand Down

0 comments on commit 0f7948a

Please sign in to comment.