fix dimmable states

This commit is contained in:
britea 2020-04-28 10:57:35 +02:00
parent 7135ddc588
commit 5e055bc477

View File

@ -378,10 +378,10 @@ export const RemoteService = {
updateState: (data, type) => { updateState: (data, type) => {
return (dispatch) => { return (dispatch) => {
let url; let url;
if (type === "dimmableState") { if (data.on) {
url = "/dimmableState";
} else {
url = "/switchableState"; url = "/switchableState";
} else {
url = "/dimmableState";
} }
return Endpoint.put(url, {}, data) return Endpoint.put(url, {}, data)