From 619d238a8eededb6744a84fb21f42f8accd0fe6b Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Wed, 21 Sep 2022 14:34:22 +0200 Subject: [PATCH] added mvmt detection of store for vibration --- hooks/scripts/rdc_store.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hooks/scripts/rdc_store.php b/hooks/scripts/rdc_store.php index f00b044..f79aa5a 100644 --- a/hooks/scripts/rdc_store.php +++ b/hooks/scripts/rdc_store.php @@ -51,9 +51,9 @@ class rdc_store extends hook if ($this->active == true) { - if (array_key_exists("vibration", $indexDevices[RDC_store_vibration]->properties)) + if (array_key_exists("vibration", $indexDevices[RDC_STORE_VIBRATION]->properties)) { - $lastVibration = $mohaDB->moyenne($indexDevices[RDC_store_vibration], "vibration", 5); + $lastVibration = $mohaDB->moyenne($indexDevices[RDC_STORE_VIBRATION], "vibration", 5); logger(DEBUG, "Last vibration inferior to 5 minutes" . bool2string($lastVibration ), __FILE__ . ":" . __LINE__); } if (array_key_exists("moving", $storeDevice->properties)) @@ -200,7 +200,10 @@ class rdc_store extends hook { $this->setTo($tmpStore, AUTO); }*/ - $this->maxLevel -= 20; + if ($moving = "STOP") + { + $this->maxLevel -= 20; + } default: break; }