App loader; Snapcast group volume
This commit is contained in:
@ -265,3 +265,19 @@ export function setSnapcastGroupStream(id, stream_id){
|
||||
}
|
||||
}
|
||||
|
||||
export function setSnapcastGroupMute(id, mute){
|
||||
return {
|
||||
type: 'PUSHER_SET_SNAPCAST_GROUP_MUTE',
|
||||
id: id,
|
||||
mute: mute
|
||||
}
|
||||
}
|
||||
|
||||
export function setSnapcastGroupVolume(id, percent){
|
||||
return {
|
||||
type: 'PUSHER_SET_SNAPCAST_GROUP_VOLUME',
|
||||
id: id,
|
||||
percent: percent
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -873,6 +873,37 @@ const PusherMiddleware = (function(){
|
||||
);
|
||||
break
|
||||
|
||||
case 'PUSHER_SET_SNAPCAST_GROUP_MUTE':
|
||||
var group = store.getState().pusher.snapcast_groups[action.id];
|
||||
var data = {
|
||||
method: 'Group.SetMute',
|
||||
params: {
|
||||
id: action.id,
|
||||
mute: action.mute
|
||||
}
|
||||
}
|
||||
|
||||
request(store, 'snapcast_instruct', data)
|
||||
.then(
|
||||
response => {
|
||||
store.dispatch({
|
||||
type: 'PUSHER_SNAPCAST_GROUP_UPDATED',
|
||||
key: action.id,
|
||||
group: {
|
||||
muted: response.mute
|
||||
}
|
||||
})
|
||||
},
|
||||
error => {
|
||||
store.dispatch(coreActions.handleException(
|
||||
'Error',
|
||||
error,
|
||||
error.message
|
||||
));
|
||||
}
|
||||
);
|
||||
break
|
||||
|
||||
// This action is irrelevant to us, pass it on to the next middleware
|
||||
default:
|
||||
return next(action);
|
||||
|
||||
Reference in New Issue
Block a user