From acda2faa7bd701c4e812a74087a9d4287ea16c0c Mon Sep 17 00:00:00 2001 From: Michael Maroszek Date: Tue, 10 Dec 2024 18:04:36 +0100 Subject: [PATCH] fix problem without switching phase option set --- E-Car/module.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/E-Car/module.php b/E-Car/module.php index 2c84485..b20bcad 100644 --- a/E-Car/module.php +++ b/E-Car/module.php @@ -255,7 +255,12 @@ public function Update() break; case 2: if (!$this->ReadPropertyBoolean('SplitPhases')) { - $value = $this->GetValue('CurrentL12') * $volt * $this->GetValue('Phases'); + if ($this->ReadPropertyBoolean('Switching')) { + $value = $this->GetValue('CurrentL12') * $volt * $this->GetValue('Phases'); + } + else { + $value = $this->GetValue('CurrentL123') * $volt * 2; + } } elseif ($this->ReadPropertyBoolean('SplitPhases')) { $value += $this->GetValue('CurrentL1') * $volt; $value += $this->GetValue('CurrentL2') * $volt; @@ -263,7 +268,12 @@ public function Update() break; case 3: if (!$this->ReadPropertyBoolean('SplitPhases')) { - $value = $this->GetValue('CurrentL123') * $volt * $this->GetValue('Phases'); + if ($this->ReadPropertyBoolean('Switching')) { + $value = $this->GetValue('CurrentL123') * $volt * $this->GetValue('Phases'); + } + else { + $value = $this->GetValue('CurrentL123') * $volt * 3; + } } elseif ($this->ReadPropertyBoolean('SplitPhases')) { $value += $this->GetValue('CurrentL1') * $volt; $value += $this->GetValue('CurrentL2') * $volt;