From bba42e0c1570031a007b801db7e608799fe50ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= <1536036+zoic21@users.noreply.github.com> Date: Tue, 4 Jun 2024 11:05:07 +0200 Subject: [PATCH] fix #2610 --- core/class/history.class.php | 6 +++--- core/config/default.config.ini | 1 + desktop/modal/cmd.configure.php | 5 +++-- desktop/php/administration.php | 13 +++++++++++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/core/class/history.class.php b/core/class/history.class.php index 2b8b9b0606..48e1872a8f 100644 --- a/core/class/history.class.php +++ b/core/class/history.class.php @@ -1027,14 +1027,14 @@ public function save($_cmd = null, $_direct = false) { $this->setValue(round($this->getValue(), $cmd->getConfiguration('historizeRound'))); } if ( $JEEDOM_INTERNAL_CONFIG['cmd']['type']['info']['subtype'][$cmd->getSubType()]['isHistorized']['canBeSmooth'] - && $cmd->getConfiguration('smooth', 0) > 0 + && $cmd->getConfiguration('history::smooth', config::byKey('history::smooth','core',0)) > 0 && $cmd->getConfiguration('historizeMode', 'none') != 'none' && $this->getValue() !== null ) { if ($this->getTableName() == 'history') { $time = strtotime($this->getDatetime()); - $time -= $time % $cmd->getConfiguration('smooth', 0); + $time -= $time % $cmd->getConfiguration('smooth', config::byKey('history::smooth','core',0)); if ($this->getValue() == 0) { - $this->setDatetime(date('Y-m-d H:i:00', $time + $cmd->getConfiguration('smooth', 0))); + $this->setDatetime(date('Y-m-d H:i:00', $time + $cmd->getConfiguration('smooth', config::byKey('history::smooth','core',0)))); $values = array( 'cmd_id' => $this->getCmd_id(), 'datetime' => date('Y-m-d H:i:00', strtotime($this->getDatetime())), diff --git a/core/config/default.config.ini b/core/config/default.config.ini index 7bafc45386..e9f68aa34f 100644 --- a/core/config/default.config.ini +++ b/core/config/default.config.ini @@ -69,6 +69,7 @@ historyArchiveTime = 2 historyArchivePackage = 1 displayStatsWidget = 0 history::defautShowPeriod = -1 month +history::smooth = 0 ;security security::maxFailedLogin = 6 diff --git a/desktop/modal/cmd.configure.php b/desktop/modal/cmd.configure.php index 6e432d9434..e85218ca1b 100644 --- a/desktop/modal/cmd.configure.php +++ b/desktop/modal/cmd.configure.php @@ -516,8 +516,9 @@
- + + diff --git a/desktop/php/administration.php b/desktop/php/administration.php index ea1fb1a0a3..505a5d6cb8 100644 --- a/desktop/php/administration.php +++ b/desktop/php/administration.php @@ -1170,6 +1170,19 @@
+
+ +
+ +
+