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"){
return state.devices[ownProps.id];
}else{
const sceneState = 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
* data.id is truthy, then a update call is performed,