fix to stateOrDevice

This commit is contained in:
Jacob Salvi 2020-04-25 17:46:43 +02:00
parent b301c97212
commit 1e668f499d
2 changed files with 1 additions and 17 deletions

View file

@ -160,6 +160,7 @@ const mapStateToProps = (state, ownProps) => ({
if(state.active.activeTab==="Devices"){ if(state.active.activeTab==="Devices"){
return state.devices[ownProps.id]; return state.devices[ownProps.id];
}else{ }else{
const sceneState = state.sceneStates[ownProps.id];
return state.sceneStates[ownProps.id]; return state.sceneStates[ownProps.id];
} }
}, },

View file

@ -396,23 +396,6 @@ export const RemoteService = {
}; };
}, },
deleteState: (id,type)=>{
return (dispatch) => {
let url;
if(type=="dimmableState"){
url="/dimmableState"
}else{
url="/switchableState"
}
return Endpoint.delete(url+`/${id}`)
.then((res) => dispatch(actions.statesUpdate([res.data])))
.catch((err) => {
console.warn(`reset error`, err);
throw new RemoteError(["Network error"]);
});
};
},
/** /**
* Creates/Updates a device with the given data. If * Creates/Updates a device with the given data. If
* data.id is truthy, then a update call is performed, * data.id is truthy, then a update call is performed,