Skip to content

Commit

Permalink
Merge pull request #188 from Burki24/patch-3
Browse files Browse the repository at this point in the history
FIX: Z2M_ServingTime
  • Loading branch information
Schnittcher authored May 12, 2024
2 parents 44d56ef + 33ccf3d commit 727619e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Device/locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
"Brightness move up": "Helligkeit erhöhen",
"Brightness Move Up 1": "Helligkeit Schrittweise erhöhen 1",
"Brightness Move Up 2": "Helligkeit Schrittweise erhöhen 2",

"Brightness RGB": "Helligkeit RGB",
"Brightness State": "Helligkeitszustand",
"Brightness Step Down": "Helligkeit Schrittweise senken",
Expand Down Expand Up @@ -755,6 +754,7 @@
"Thursday": "Donnerstag",
"Tilt": "Neigung",
"Toggle": "Wechsel",
"Toggle Hold": "Wechsel Halten",
"Toilet": "Badezimmer",
"Tokyo": "Tokio",
"Transmit Power": "Signalstärke",
Expand Down
31 changes: 24 additions & 7 deletions libs/Zigbee2MQTTHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ public function ReceiveData($JSONString)
$this->SetValue('Z2M_WeightPerDay', $Payload['weight_per_day']);
}
if (array_key_exists('serving_size', $Payload)) {
$this->SetValue('Z2M_ServeingSize', $Payload['serving_size']);
$this->SetValue('Z2M_ServingSize', $Payload['serving_size']);
}
if (array_key_exists('portion_weight', $Payload)) {
$this->SetValue('Z2M_PortionWeight', $Payload['portion_weight']);
Expand All @@ -864,10 +864,6 @@ public function ReceiveData($JSONString)
$this->SetValue('Z2M_PortionsPerDay', $Payload['portions_per_day']);
}





if (array_key_exists('execute_if_off', $Payload)) {
$this->handleStateChange('execute_if_off', 'Z2M_ExecuteIfOff', 'Execute If Off', $Payload);
}
Expand Down Expand Up @@ -2478,6 +2474,7 @@ private function registerVariableProfile($expose)
case 'Z2M.feed.00000000':
if (!IPS_VariableProfileExists($ProfileName)) {
$this->RegisterProfileStringEx($ProfileName, 'Feed', '', '', [
[' ', ' ', '', 0x00FF00],
['START', $this->Translate('Start'), '', 0x00FF00],
]);
}
Expand Down Expand Up @@ -3112,6 +3109,26 @@ private function registerVariableProfile($expose)
]);
}
break;
case 'Z2M.action.9dc63e5e':
if (!IPS_VariableProfileExists($ProfileName)) {
$this->RegisterProfileStringEx($ProfileName, 'Information', '', '', [
['arrow_left_click', $this->Translate('Arrow Left Click'), '', 0x00FF00],
['arrow_left_hold', $this->Translate('Arrow Left Hold'), '', 0x00FF00],
['arrow_left_release', $this->Translate('Arrow Left Release'), '', 0x00FF00],
['arrow_right_click', $this->Translate('Arrow Right click'), '', 0x00FF00],
['arrow_right_hold', $this->Translate('Arrow Right Hold'), '', 0x00FF00],
['arrow_right_release', $this->Translate('Arrow Right Release'), '', 0x00FF00],
['brightness_down_hold', $this->Translate('Brightness Down Hold'), '', 0x00FF00],
['brightness_down_release', $this->Translate('Brightness Down Release'), '', 0x00FF00],
['brightness_down_click', $this->Translate('Brightness Down click'), '', 0x00FF00],
['brightness_up_click', $this->Translate('Brightness Up click'), '', 0x00FF00],
['brightness_up_hold', $this->Translate('Brightness Up Hold'), '', 0x00FF00],
['brightness_up_release', $this->Translate('Brightness Up Release'), '', 0x00FF00],
['toggle', $this->Translate('Toggle'), '', 0x00FF00],
['toggle_hold', $this->Translate('Toggle Hold'), '', 0x00FF00],
]);
}
break;
case 'Z2M.action.817f2757':
case 'Z2M.action.bdac7927':
case 'Z2M.action.301a3bd1':
Expand Down Expand Up @@ -5963,8 +5980,8 @@ private function mapExposesToVariables(array $exposes)
$ProfileName = $this->registerVariableProfile($expose);
if ($ProfileName != false) {
$this->RegisterVariableInteger('Z2M_FeedingSize', $this->Translate('Feeding Size'), $ProfileName);
$this->EnableAction('Z2M_FeedingSize');
}
$this->EnableAction('Z2M_FeedingSize');
}
break;
case 'voc_index':
$ProfileName = $this->registerVariableProfile($expose);
Expand Down

0 comments on commit 727619e

Please sign in to comment.