From c419ba636a2c1816cb002f25fad674424fa28d33 Mon Sep 17 00:00:00 2001 From: TrystanLea Date: Thu, 11 Mar 2021 13:45:16 +0000 Subject: [PATCH] basic modification to enable direct rather than timer control --- demandshaper_run.php | 7 ++++++- devices/emonesp.php | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/demandshaper_run.php b/demandshaper_run.php index aea662d..392aabb 100644 --- a/demandshaper_run.php +++ b/demandshaper_run.php @@ -197,7 +197,12 @@ if (count($schedule->runtime->periods)) { $s1 = time_offset($schedule->runtime->periods[$active_period]->start[1],-$timeOffset); $e1 = time_offset($schedule->runtime->periods[$active_period]->end[1],-$timeOffset); - $device_class[$device_type]->timer($device,$s1,$e1,$s2,$e2); + // $device_class[$device_type]->timer($device,$s1,$e1,$s2,$e2); + if ($status) { + $device_class[$device_type]->on($device); + } else { + $device_class[$device_type]->off($device); + } } } else if ($schedule->settings->ctrlmode=="on") $device_class[$device_type]->on($device); diff --git a/devices/emonesp.php b/devices/emonesp.php index 74ce5cf..66528d3 100644 --- a/devices/emonesp.php +++ b/devices/emonesp.php @@ -79,6 +79,9 @@ public function send_state_request($device) { public function handle_state_response($schedule,$message,$timezone) { + // disable for now + return false; + $device = $schedule->settings->device; if ($message->topic==$this->basetopic."/$device/out/state") {