Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/work.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
# Workflows check plugin Jeedom
push:
branches:
- beta
pull_request:
branches:
- beta
- master

name : 'Full Workflows Plugin Jeedom'

jobs:
plugin:
uses: jeedom/workflows/.github/workflows/plugin.yml@main
22 changes: 16 additions & 6 deletions core/class/energy3.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ public function calculSolarPrevision() {


public function calculImportExport() {
$net_power = jeedom::evaluateExpression($this->getConfiguration('elec::net::power'));
$elec_production = jeedom::evaluateExpression($this->getConfiguration('elec::production::instant'));
$net_power = (float) jeedom::evaluateExpression($this->getConfiguration('elec::net::power'));
$elec_production = (float) jeedom::evaluateExpression($this->getConfiguration('elec::production::instant'));
if ($net_power > 0) {
$this->checkAndUpdateCmd('elec::import::instant', $net_power);
$this->checkAndUpdateCmd('elec::export::instant', 0);
Expand All @@ -165,14 +165,24 @@ public function calculImportExport() {
} else {
$this->checkAndUpdateCmd('elec::production::consumption::instant', 0);
}
if (!is_numeric($net_power)) {
$net_power = 0;
}
if (!is_numeric($elec_production)) {
$elec_production = 0;
}
$this->checkAndUpdateCmd('elec::consumption::instant', $elec_production + $net_power);
}

public function calculPerformance() {
$production = $this->getCmd('info', 'elec::production')->execCmd();
$export = $this->getCmd('info', 'elec::export')->execCmd();
$consumption = $this->getCmd('info', 'elec::consumption')->execCmd();
$autoconsumption = round((($production - $export) / $production) * 100, 1);
$production = (float) $this->getCmd('info', 'elec::production')->execCmd();
$export = (float) $this->getCmd('info', 'elec::export')->execCmd();
$consumption = (float) $this->getCmd('info', 'elec::consumption')->execCmd();
if ($production > 0) {
$autoconsumption = round((($production - $export) / $production) * 100, 1);
}else {
$autoconsumption = 0;
}
if ($autoconsumption < 0) {
$autoconsumption = 0;
} elseif ($autoconsumption > 100) {
Expand Down
4 changes: 2 additions & 2 deletions desktop/php/energy3.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
foreach ($eqLogics as $eqLogic) {
$opacity = ($eqLogic->getIsEnable()) ? '' : 'disableCard';
echo '<div class="eqLogicDisplayCard cursor ' . $opacity . '" data-eqLogic_id="' . $eqLogic->getId() . '">';
echo '<img src="' . $plugin->getPathImgIcon() . '">';
echo '<img src="' . $eqLogic->getImage() . '"/>';
echo '<br>';
echo '<span class="name">' . $eqLogic->getHumanName(true, true) . '</span>';
echo '<span class="hiddenAsCard displayTableRight hidden">';
Expand Down Expand Up @@ -343,4 +343,4 @@
<!-- Inclusion du fichier javascript du plugin (dossier, nom_du_fichier, extension_du_fichier, id_du_plugin) -->
<?php include_file('desktop', 'energy3', 'js', 'energy3'); ?>
<!-- Inclusion du fichier javascript du core - NE PAS MODIFIER NI SUPPRIMER -->
<?php include_file('core', 'plugin.template', 'js'); ?>
<?php include_file('core', 'plugin.template', 'js'); ?>
5 changes: 4 additions & 1 deletion docs/fr_FR/changelog.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Changelog plugin template
# Changelog plugin Energie dashboard

>**IMPORTANT**
>
>S'il n'y a pas d'information sur la mise à jour, c'est que celle-ci concerne uniquement de la mise à jour de documentation, de traduction ou de texte.

- Support des images d'équipement personnalisées (Jeedom 4.5)
- Correction de bug sous debian 12

# 04/04/2024

- Correction d'un soucis de lisibilité du widget (#15)
Expand Down