* the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Jeedom is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Jeedom. If not, see <http://www.gnu.org/licenses/>. */ if (init('id') == '') { throw new Exception('{{L\'id de l\'équipement ne peut etre vide : }}' . init('op_id')); } $id = init('id'); $porkfolio = porkfolio::byId($id); if (!is_object($porkfolio)) { throw new Exception(__('Aucun equipement ne correspond : Il faut (re)-enregistrer l\'équipement ', __FILE__) . init('action')); } $id = $porkfolio->getId(); $nez = $porkfolio->getCmd(null, 'nez')->execCmd(); ?> <div class="alert alert-info"> Choisissez la couleur du nez de votre porkfolio. La couleur actuelle est <i class="fa fa-circle fa-lg" style="color : #<?php echo $nez; ?> ;"></i>. </div> <div id="nezcouleur"> <input type="color" id="couleur" name='<?php echo $id;
public function changeobjectifporkfolio($id, $objectif) { $porkfolio = porkfolio::byId($id); $porkid = $porkfolio->getConfiguration('porkid'); $objectif = $objectif * 100; $cmd = '/usr/bin/python ' . dirname(__FILE__) . '/../../3rdparty/py-wink-adapt/set_info.py ' . $porkid . ' Objectif ' . $objectif . ' 2>&1 &'; log::add('porkfolio', 'debug', 'Execution de la commande suivante : ' . $cmd); $resultid = exec($cmd); log::add('porkfolio', 'debug', 'Le retour de la commande est : ' . $resultid); $porkfolio->cronHourly(); }