Skip to content

Commit

Permalink
Merge pull request #221 from Burki24/patch-4
Browse files Browse the repository at this point in the history
ADD: Z2M_Rain
  • Loading branch information
Schnittcher authored Dec 9, 2024
2 parents 3fa49ca + cf832e2 commit 68eca5f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion libs/Zigbee2MQTTHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,9 @@ public function ReceiveData($JSONString)
if (array_key_exists('cleaning_reminder', $Payload)) {
$this->SetValue('Z2M_CleaningReminder', $Payload['cleaning_reminder']);
}
if (array_key_exists('rain', $Payload)) {
$this->SetValue('Z2M_Rain', $Payload['rain']);
}
if (array_key_exists('rain_intensity', $Payload)) {
$this->SetValue('Z2M_RainIntensity', $Payload['rain_intensity']);
}
Expand Down Expand Up @@ -4374,8 +4377,10 @@ private function registerVariableProfile($expose)
case 'numeric':
switch ($expose['property']) {
case 'rain_intensity':
// Setze 'unit' auf einen leeren String, falls es nicht gesetzt ist
$unit = isset($expose['unit']) ? $expose['unit'] : '';
if (!IPS_VariableProfileExists($ProfileName)) {
$this->RegisterProfileInteger($ProfileName, 'Information', '', ' ', 0, 0, 1, 0);
$this->RegisterProfileInteger($ProfileName, 'Information', '', ' ' . $unit, 0, 0, 1, 0);
}
break;
case 'illuminance_maximum_today':
Expand Down Expand Up @@ -5016,6 +5021,9 @@ private function mapExposesToVariables(array $exposes)
switch ($feature['type']) {
case 'binary':
switch ($feature['property']) {
case 'rain':
$this->RegisterVariableBoolean('Z2M_Rain', $this->Translate('Rain'), '~Switch');
break;
case 'learn_ir_code':
$this->RegisterVariableBoolean('Z2M_LearnIRCode', $this->Translate('Learn IR Code'), '~Switch');
$this->EnableAction('Z2M_LearnIRCode');
Expand Down

0 comments on commit 68eca5f

Please sign in to comment.