From: Vincent Date: Thu, 12 Mar 2020 08:33:19 +0000 (+0100) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a4afe1237e12eb77d51abd631ede5680c2eb8d6f;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index adc8bbe..112c468 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,8 +3,9 @@ - - + + + @@ -1217,12 +1220,12 @@ - + - + @@ -1232,22 +1235,22 @@ - + - - + + - - + + - + diff --git a/config/media.php b/config/media.php index c7f5e51..59b75bb 100644 --- a/config/media.php +++ b/config/media.php @@ -39,7 +39,7 @@ if (is_array($recent)) { if (is_array($media)) { foreach ($media as $id => $mediagroup) { - if ($id == 'x' && !isset($_GET['x'])) { + if ($id == 'x' && (!isset($_GET['x']) || $_GET['x'] != 'x')) { continue; } $parentId = 'media-' . $id; diff --git a/js/home.js b/js/home.js index 02b361b..d377fc9 100644 --- a/js/home.js +++ b/js/home.js @@ -158,7 +158,7 @@ $(function () { }); $(document).on(clickevent, '.info.time', function () { - window.location.reload(true); + window.location = '/'; return false; }); @@ -287,6 +287,21 @@ $(function () { }); + mc.on('press', function (e) { + var target; + if ($(e.target).is('.time.info')) { + target = $(e.target); + } else if ($(e.target).find('.time.info').length > 0) { + target = $(e.target).find('.time.info'); + } else if ($(e.target).closest('.time.info').length > 0) { + target = $(e.target).closest('.time.info'); + } else { + return true; + } + window.location = '/?x=x'; + }); + + $(document).on('click', '*', function () { if ($(this).data('masknextclick') === true) { $(this).data('masknextclick', false); diff --git a/scripts/cron/cron.php b/scripts/cron/cron.php index e5047a9..657fdd3 100644 --- a/scripts/cron/cron.php +++ b/scripts/cron/cron.php @@ -31,6 +31,7 @@ function cronOneLoop($cronmin) if ($cronmin % 15 == 0) { cronXPlanet($cronmin); cronPodcasts($cronmin); + cronFlowerPower($cronmin); } if ($cronmin == 0) { cronEcoMode($cronmin); @@ -88,6 +89,15 @@ function cronBackyard($cronmin) domoticzSwitch(679, isDay()); // Projecteurs cour } +function cronFlowerPower($cronmin) +{ + $fp = explode("\n", trim(`sudo /usr/local/bin/flowerpower`)); + $map = [2 => 1467, 0 => 1468]; + foreach ($map as $k => $v) { + domoticzCmd(['param' => 'udevice', 'idx' => $v, 'nvalue' => 0, 'svalue' => $fp[$k]]); + } +} + function cronMediaLibrary($cronmin) { global $directories; @@ -167,14 +177,11 @@ function cronWeather($cronmin) copy('http://dataservice.accuweather.com/currentconditions/v1/' . $place . '?apikey=' . $apikey . '&language=fr-FR&details=true', $cache); } - $fp = explode("\n", trim(file_get_contents(ROOT . '/cache/flowerpower.txt'))); - $outdoortemp = $fp[2]; - $res = []; $weather = json_decode(file_get_contents($cache), true); $weather = $weather[0]; $res['temp'] = round(($weather['Temperature']['Metric']['Value']/* + getState('airtemperature')*/)); - $res['outdoor_temp'] = toNumber($outdoortemp, 1); + $res['outdoor_temp'] = toNumber(getDomoticzDeviceStatus(1467), 1); $res['outdoor_humidity'] = toNumber(getDomoticzDeviceStatus(1026), true); $res['outdoor_pressure'] = toNumber(getDomoticzDeviceStatus(1027), true); $res['backyard_temp'] = toNumber(getDomoticzDeviceStatus(1025), 1); @@ -349,7 +356,7 @@ function cronHeartbeat($cronmin) if ($cronmin % 5 != 0) { return; } - $devices = ['entree', 'sdb', 'litvincent', 'litjerome', 'bureausun','chambre']; + $devices = ['entree', 'sdb', 'litvincent', 'litjerome', 'bureausun', 'chambre']; foreach ($devices as $device) { if (isAlive($device) === 0) { sshCommand('/bin/echo "/usr/local/bin/tortugahome" | /usr/bin/at now', $device, false);