Skip to content

Commit

Permalink
Merge pull request #3008 from Flobul/alpha
Browse files Browse the repository at this point in the history
[BUGFIX] Refreshing battery widget on eqAnalyse page
  • Loading branch information
zoic21 authored Jan 5, 2025
2 parents 09eefcd + 31772a6 commit deb1a6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/class/eqLogic.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ public function batteryWidget($_version = 'dashboard') {
}
$classAttr = $level . ' ' . $battery . ' ' . $plugins . ' ' . $object_name;
$idAttr = $level . '__' . $battery . '__' . $plugins . '__' . $object_name;
$html .= '<div class="eqLogic eqLogic-widget text-center ' . $classAttr . '" id="' . $idAttr . '" data-eqlogic_id="' . $this->getId() . '">';
$html .= '<div class="eqLogic eqLogic-widget battery-widget text-center ' . $classAttr . '" id="' . $idAttr . '" data-eqlogic_id="' . $this->getId() . '">';

$eqName = $this->getName();
if ($_version == 'mobile') {
Expand Down
4 changes: 4 additions & 0 deletions core/js/eqLogic.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ jeedom.eqLogic.refreshValue = function(_params) {

eqLogics[_params[i].eqLogic_id] = {
eqLogic: eqLogic,
type: eqLogic?.classList.contains('battery-widget') ? 'battery' : 'default'
}
sends[_params[i].eqLogic_id] = {
version: ((version = eqLogic?.getAttribute('data-version')) != undefined) ? version : 'dashboard'
Expand All @@ -492,6 +493,9 @@ jeedom.eqLogic.refreshValue = function(_params) {
if (tile.childNodes.length == 0) {
continue
}
if (eqLogics[i].type === 'battery') {
continue
}
eqLogic = eqLogics[i].eqLogic
if (isElement_jQuery(eqLogic)) eqLogic = eqLogic[0]
if (eqLogic == null) {
Expand Down

0 comments on commit deb1a6d

Please sign in to comment.