diff --git a/smart-hut/src/remote.js b/smart-hut/src/remote.js index 5f4f49c..af0353d 100644 --- a/smart-hut/src/remote.js +++ b/smart-hut/src/remote.js @@ -378,10 +378,10 @@ export const RemoteService = { updateState: (data, type) => { return (dispatch) => { let url; - if (type === "dimmableState") { - url = "/dimmableState"; - } else { + if (data.on) { url = "/switchableState"; + } else { + url = "/dimmableState"; } return Endpoint.put(url, {}, data)