Skip to content

Commit

Permalink
Fix Style
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnittcher committed Aug 3, 2024
1 parent 899afd0 commit ada7025
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions Gen3Shelly1Mini/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,27 +106,27 @@ public function ReceiveData($JSONString)
}
}
if (fnmatch('*/status/switch:0', $Buffer['Topic'])) {
if (array_key_exists('output', $Payload)) {
$this->SetValue('State', $Payload['output']);
}
if (array_key_exists('apower', $Payload)) {
$this->SetValue('Power', $Payload['apower']);
}
if (array_key_exists('voltage', $Payload)) {
$this->SetValue('Voltage', $Payload['voltage']);
}
if (array_key_exists('current', $Payload)) {
$this->SetValue('Current', $Payload['current']);
}
if (array_key_exists('aenergy', $Payload)) {
if (array_key_exists('total', $Payload['aenergy'])) {
$this->SetValue('TotalEnergy', $Payload['aenergy']['total'] / 1000);
}
}
if (array_key_exists('output', $Payload)) {
$this->SetValue('State', $Payload['output']);
}
if (array_key_exists('apower', $Payload)) {
$this->SetValue('Power', $Payload['apower']);
}
if (array_key_exists('voltage', $Payload)) {
$this->SetValue('Voltage', $Payload['voltage']);
}
if (array_key_exists('current', $Payload)) {
$this->SetValue('Current', $Payload['current']);
}
if (array_key_exists('aenergy', $Payload)) {
if (array_key_exists('total', $Payload['aenergy'])) {
$this->SetValue('TotalEnergy', $Payload['aenergy']['total'] / 1000);
}
}
}
}
}
}

public function ToggleAfter(int $switch, bool $value, int $toggle_after)
{
Expand Down

0 comments on commit ada7025

Please sign in to comment.