Moving commands out of Snapcast

This commit is contained in:
James Barnsley
2018-10-09 21:39:38 +13:00
parent 9f0961f593
commit fc3f5e2d2f
20 changed files with 11052 additions and 14208 deletions

View File

@ -76,21 +76,16 @@ class OutputControl extends React.Component{
clients.map(client => {
var commands = {};
if (this.props.snapcast_client_commands[client.id]){
commands = this.props.snapcast_client_commands[client.id];
if (this.props.snapcast_commands[client.id]){
commands = this.props.snapcast_commands[client.id];
}
return (
<div className={"output-control__item outputs__item--snapcast"+(commands && commands.power ? " output-control__item--has-power-button": '')} key={client.id}>
<div className="output-control__item outputs__item--snapcast" key={client.id}>
<div className="output-control__item__name">
{client.name}
</div>
<div className="output-control__item__controls">
{commands && commands.power ? <SnapcastPowerButton
className="output-control__item__power"
client={client}
onClick={e => this.props.snapcastActions.sendClientCommand(client.id, commands.power)}
/> : null}
<MuteControl
className="output-control__item__mute"
noTooltip={true}
@ -189,7 +184,7 @@ const mapStateToProps = (state, ownProps) => {
pusher_connected: state.pusher.connected,
snapcast_enabled: (state.pusher.config ? state.pusher.config.snapcast_enabled : null),
snapcast_clients: state.snapcast.clients,
snapcast_client_commands: (state.snapcast.client_commands ? state.snapcast.client_commands : {})
snapcast_commands: (state.snapcast.commands ? state.snapcast.commands : {})
}
}