Bonjour, il me semble que j'avais cette erreur un moment donné. J'ai recomparé mon code de plugins/thermoAlternateView/core/class/thermoAlternateView.class.php avec celui original, Et je vois que j'avais des modifs pour enlever un problème de point non trouvé quand les températures n'ont pas de décimal.
Voici le code la fonction toHtml
Code : Tout sélectionner
public function toHtml($_version = 'dashboard')
{
$replace = $this->preToHtml($_version);
if (!is_array($replace)) {
return $replace;
}
$version = jeedom::versionAlias($_version);
$idThermostat = $this->getConfiguration('thermostat');
$template = $this->getConfiguration('template');
$isVisibleTempExt = $this->getConfiguration('isvisibletempext');
$isVisibleConsigne = $this->getConfiguration('isVisibleConsigne');
$isEnableBackColorStd = $this->getConfiguration('isEnableBackColorStd');
$isDisabledMode = $this->getConfiguration('isDisabledMode');
$isDefaultFlameColor = $this->getConfiguration('isDefaultFlameColor');
$flameColor = $this->getConfiguration('flameColor');
$isDefaultFanColor = $this->getConfiguration('isDefaultFanColor');
$fanColor = $this->getConfiguration('fanColor');
$isDefaultWaitColor = $this->getConfiguration('isDefaultWaitColor');
$waitColor = $this->getConfiguration('waitColor');
$isDefaultLockColor = $this->getConfiguration('isDefaultLockColor');
$lockColor = $this->getConfiguration('lockColor');
$thermoUnit = $this->getConfiguration('thermoUnit');
$thermostat = eqLogic::byId($idThermostat);
$islocked = 0;
$mode = "";
$statut = ""; // Arrêté
$cmdStatutId = 0;
$cmdModeId = 0;
$cmdTempInterId = 0;
$cmdTempExterId = 0;
$tempConsigneId = 0;
$cmdThermostatHisto = "";
$cmdTempInterHisto = "";
$cmdTempExterHisto = "";
$cmdLockId = 0;
$cmdUnlockId = 0;
$cmdThermostatId = 0;
$tempInterieure = 0;
$tempExterieure = 0;
$modes = array();
$htmlModes = "";
$htmlModesMobile = "";
$modeIcon = "";
//Parcours chaque commande du thermostat
foreach (cmd::byEqLogicId($idThermostat) as $commande) {
switch ($commande->getLogicalId()) {
case "modeAction":
case "off":
if ($commande->getIsVisible()) {
$modes[strtolower($commande->getName())] = $commande->getId();
}
break;
case "lock":
$cmdLockId = $commande->getId();
break;
case "unlock":
$cmdUnlockId = $commande->getId();
break;
case "lock_state":
$islocked = $commande->execCmd();
break;
case "thermostat":
$cmdThermostatId = $commande->getId();
break;
case "status":
$cmdStatutId = $commande->getId();
$statut = $commande->execCmd();
break;
case "mode":
$cmdModeId = $commande->getId();
$mode = strtolower($commande->execCmd());
break;
case "temperature":
$cmdTempInterId = $commande->getId();
$tempInterieure = $commande->execCmd();
$cmdTempInterHisto = $commande->getIsHistorized();
break;
case "temperature_outdoor":
$cmdTempExterId = $commande->getId();
$tempExterieure= $commande->execCmd();
$cmdTempExterHisto = $commande->getIsHistorized();
break;
case "order":
$tempConsigneId = $commande->getId();
$tempConsigne = $commande->execCmd();
$cmdConsigneHisto = $commande->getIsHistorized();
break;
}
}
$modesCompatibles = array('confort', 'eco', 'absent', 'off', 'vacances', 'nuit', 'jour', 'confort-2', 'horsgel');
if ($isDisabledMode != "1") {
foreach ($modes as $modeActionName => $modeActionId) {
$modeEscapeActionName = str_replace(' ', '', $modeActionName);
if (in_array($modeEscapeActionName, $modesCompatibles)) {
$modeIcon = $modeEscapeActionName;
} else {
switch ( $modeEscapeActionName ) {
case 'vacance':
$modeIcon = 'vacances';
break;
default:
$modeIcon = 'other';
}
}
if ($mode == $modeActionName) {
$htmlModes = $htmlModes . '<span class="thermo-switch-on thermo-tooltip"><span class="thermo-tooltiptext">' . ucfirst($modeActionName) . '</span><svg data-mode="' . $modeEscapeActionName . '" data-mode-humanname="' . $modeActionName . '" class="thermo-mode-label thermo-mode-label-on"><use xlink:href="plugins/thermoAlternateView/resources/images.svg#shape-icon-' . $modeIcon . '" /></svg><svg class="thermo-mode-switch" data-cmd_id=' . $modeActionId . '><use xlink:href="plugins/thermoAlternateView/resources/images.svg#shape-switch-on" /></svg></span>';
$htmlModesMobile = $htmlModesMobile . '<span class="thermo-switch-on"><svg data-mode="' . $modeEscapeActionName . '" data-mode-humanname="' . $modeActionName . '" class="thermo-mode-label thermo-mode-label-on"><use xlink:href="plugins/thermoAlternateView/resources/images.svg#shape-icon-' . $modeIcon . '" /></svg><svg style="display:none;" class="thermo-mode-switch" data-cmd_id=' . $modeActionId . '></svg></span>';
} else {
$htmlModes = $htmlModes . '<span class="thermo-switch-off thermo-tooltip"><span class="thermo-tooltiptext">' . ucfirst($modeActionName) . '</span><svg data-mode="' . $modeEscapeActionName . '" data-mode-humanname="' . $modeActionName . '" class="thermo-mode-label"><use xlink:href="plugins/thermoAlternateView/resources/images.svg#shape-icon-' . $modeIcon . '" /></svg><svg class="thermo-mode-switch" data-cmd_id=' . $modeActionId . '><use xlink:href="plugins/thermoAlternateView/resources/images.svg#shape-switch-off" /></svg></span>';
$htmlModesMobile = $htmlModesMobile . '<span class="thermo-switch-off"><svg data-mode="' . $modeEscapeActionName . '" data-mode-humanname="' . $modeActionName . '" class="thermo-mode-label"><use xlink:href="plugins/thermoAlternateView/resources/images.svg#shape-icon-' . $modeIcon . '" /></svg><svg style="display:none;" class="thermo-mode-switch" data-cmd_id=' . $modeActionId . '></svg></span>';
}
}
}
//Prochaine consigne
$replace['#nextConsigne-visible#'] = $isVisibleConsigne == "1" ? "bloc" : "none";
if ( $isVisibleConsigne == '1') {
$nextEvent = thermoAlternateView::getNextEventCalendar($thermostat);
}
//Icone de verrouillage
if ($islocked == 1) {
$replace['#lock-icon#'] = '#shape-lock-on';
$replace['#lock-id#'] = $cmdUnlockId;
$replace['#lock-id2#'] = $cmdLockId;
} else {
$replace['#lock-icon#'] = '#shape-lock-off';
$replace['#lock-id#'] = $cmdLockId;
$replace['#lock-id2#'] = $cmdUnlockId;
}
//Couleur du cadenna
$replace['#thermo-islockColor#'] = $isDefaultLockColor == "1" || $islocked == 0 ? "" : "fill:" . $lockColor;
$replace['#thermo-lockColor#'] = $isDefaultLockColor == "1" ? "" : $lockColor;
//Couleur du widget
empty($template) || $template === "default" ? $cssTempate = '': $cssTempate = ucfirst($template);
$replace['#thermo-cover#'] = $isEnableBackColorStd == "1" ? "" : "thermo". $cssTempate ."-cover-color";
$replace['#thermo-widget-name#'] = $isEnableBackColorStd == "1" ? "" : "thermo". $cssTempate ."-widget-name";
$replace['#thermo-back#'] = $isEnableBackColorStd == "1" ? "" : "thermo". $cssTempate ."-back-color";
//Couleur de la flamme
$replace['#thermo-flameColor#'] = $isDefaultFlameColor == "1" ? "" : $flameColor;
//Couleur du mode suspendu
$replace['#thermo-waitColor#'] = $isDefaultWaitColor == "1" ? "" : $waitColor;
//Couleur du mode climatisation
$replace['#thermo-fanColor#'] = $isDefaultFanColor == "1" ? "" : $fanColor;
//Modes de chauffe
if (empty($template) || $template === "default") {
$template = '';
} else {
$htmlModes = str_replace("thermo-", "thermo" . $template . "-", $htmlModes);
$htmlModesMobile = str_replace("thermo-", "thermo" . ucfirst($template) . "-", $htmlModesMobile);
$template = '_' . $template;
}
//Commandes Info
$replace["#statut-id#"] = $cmdStatutId;
$replace["#mode-id#"] = $cmdModeId;
$replace["#thermo-unit#"] = $thermoUnit;
$replace['#thermo-mode#'] = $htmlModes;
$replace['#thermo-mode-mobile#'] = $htmlModesMobile;
$replace['#thermostat-id#'] = $cmdThermostatId;
$replace['#statistics-url#'] = "index.php?v=d&m=thermostat&p=panel&object_id=" . $thermostat->getObject_id();
//Statut
switch ($statut) {
case "Chauffage":
$replace['#statut-icon#'] = "#shape-icon-flame";
$replace['#statut-color#'] = $isDefaultFlameColor == "1" ? "" : "fill:" . $flameColor;
break;
case "Suspendu":
$replace['#statut-icon#'] = "#shape-icon-wait";
$replace['#statut-color#'] = $isDefaultWaitColor == "1" ? "" : "fill:" . $waitColor;
break;
case "Climatisation":
$replace['#statut-icon#'] = "#shape-icon-fan";
$replace['#statut-color#'] = $isDefaultFanColor == "1" ? "" : "fill:" . $fanColor;
break;
default:
$replace['#statut-icon#'] = "";
$replace['#statut-color#'] = "";
}
if (stripos($tempInterieure,'.') === false) {
$entier = $tempInterieure;
$decimale = '';
}
else list($entier, $decimale) = explode(".", $tempInterieure);
$replace['#tempInterieure1#'] = $entier;
$replace['#tempInterieure2#'] = $decimale;
$replace['#tempInterieure-id#'] = $cmdTempInterId;
$replace['#temperature-value#'] = $tempInterieure;
$replace['#temperature-histo#'] = $cmdTempInterHisto == "1" ? "history cursor" : "";
$replace['#tempExterieure-id#'] = $cmdTempExterId;
$replace['#tempExterieure-value#'] = $tempExterieure;
$replace['#tempExterieure-visible#'] = $isVisibleTempExt == "1" ? "bloc" : "none";
$replace['#tempExterieure-histo#'] = $cmdTempExterHisto == "1" ? "history cursor" : "";
if (stripos($tempConsigne,'.') === false) {
$entier = $tempConsigne;
$decimale = '';
}
else list($entier, $decimale) = explode(".", $tempConsigne);
$replace['#tempConsigne1#'] = $entier;
$replace['#tempConsigne2#'] = $decimale;
$replace['#consigne-id#'] = $tempConsigneId;
$replace['#consigne-value#'] = $tempConsigne;
$replace['#consigne-histo#'] = $cmdConsigneHisto == "1" ? "history cursor" : "";
$replace['#thermo-eqLogicId#'] = $idThermostat;
$replace['#thermo-nextOccurence#'] = $nextEvent;
$parameters = $this->getDisplay('parameters');
if (is_array($parameters)) {
foreach ($parameters as $key => $value) {
$replace['#' . $key . '#'] = $value;
}
}
return template_replace($replace, getTemplate('core', $version, 'thermoAlternateView_display' . $template, 'thermoAlternateView'));
}
Vous pouvez essayez, car je n'ai pas ces erreurs