diff --git a/smart-hut/src/components/dashboard/HostsPanel.js b/smart-hut/src/components/dashboard/HostsPanel.js index 0e8e13a..50f2097 100644 --- a/smart-hut/src/components/dashboard/HostsPanel.js +++ b/smart-hut/src/components/dashboard/HostsPanel.js @@ -53,9 +53,11 @@ class HostsPanel extends Component { {scene.name} - +
- +
diff --git a/smart-hut/src/components/dashboard/devices/Videocam.js b/smart-hut/src/components/dashboard/devices/Videocam.js index 409d467..75dee30 100644 --- a/smart-hut/src/components/dashboard/devices/Videocam.js +++ b/smart-hut/src/components/dashboard/devices/Videocam.js @@ -70,11 +70,12 @@ class Videocam extends Component { /> - + this.setOnOff(val.checked)} /> diff --git a/smart-hut/src/remote.js b/smart-hut/src/remote.js index 5164ced..42a5841 100644 --- a/smart-hut/src/remote.js +++ b/smart-hut/src/remote.js @@ -557,7 +557,13 @@ export const RemoteService = { } return Endpoint.post(url) - .then((res) => dispatch(actions.deviceOperationUpdate(res.data))) + .then((res) => + dispatch( + hostId + ? actions.hostDevicesUpdate(hostId, res.data, true) + : actions.deviceOperationUpdate(res.data) + ) + ) .catch((err) => { console.warn("scene apply error", err); throw new RemoteError(["Network error"]); diff --git a/smart-hut/src/storeActions.js b/smart-hut/src/storeActions.js index 218f4b9..6a4e4e4 100644 --- a/smart-hut/src/storeActions.js +++ b/smart-hut/src/storeActions.js @@ -63,9 +63,10 @@ const actions = { devices, partial, }), - hostDevicesUpdate: (hostId, devices) => ({ + hostDevicesUpdate: (hostId, devices, partial = false) => ({ type: "HOST_DEVICES_UPDATE", hostId, + partial, devices, }), stateDelete: (stateId) => ({