From b6a27195feb8e0c6096c4d2ca29a9f42b683a8fa Mon Sep 17 00:00:00 2001 From: britea Date: Sat, 25 Apr 2020 18:27:09 +0200 Subject: [PATCH] delete state --- .../src/components/dashboard/devices/Device.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/smart-hut/src/components/dashboard/devices/Device.js b/smart-hut/src/components/dashboard/devices/Device.js index fe025ab..1c2604c 100644 --- a/smart-hut/src/components/dashboard/devices/Device.js +++ b/smart-hut/src/components/dashboard/devices/Device.js @@ -32,6 +32,10 @@ class Device extends React.Component { .catch((err) => console.error(`Smart plug reset error`, err)); } + deleteState() { + this.props.deleteState(this.props.id, this.props.type); + } + renderDeviceComponent() { console.log(JSON.stringify(this.props.stateOrDevice)); switch ( @@ -171,6 +175,15 @@ class Device extends React.Component { ? this.props.stateOrDevice.name : ""} + )}