Skip to content

Commit

Permalink
FIX:Backlight_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Burki24 committed Feb 26, 2024
1 parent 52efe8d commit aafeee4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion libs/Zigbee2MQTTHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,21 @@ public function ReceiveData($JSONString)
$this->SetValue('Z2M_TemperatureMin', $Payload['temperature_min']);
}
if (array_key_exists('backlight_mode', $Payload)) {
$this->SetValue('Z2M_BacklightMode', $Payload['backlight_mode']);
switch ($Payload['backlight_mode']) {
case 'ON':
$this->SetValue('Z2M_BacklightMode', true);
break;
case 'OFF':
$this->SetValue('Z2M_BacklightMode', false);
break;
case 'low':
case 'high':
$this->SetValue('Z2M_BacklightMode', $Payload['backlight_mode']);
break;
default:
$this->SendDebug('backlight mode', 'Undefined State: ' . $Payload['backlight_mode'], 0);
break;
}
}
if (array_key_exists('led_state', $Payload)) {
$this->SetValue('Z2M_LedState', $Payload['led_state']);
Expand Down

0 comments on commit aafeee4

Please sign in to comment.