mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-06 11:36:59 +03:00
plugin change to turn leds off on power down
This commit is contained in:
Binary file not shown.
@@ -150,6 +150,9 @@ sub power {
|
||||
$client->update_artwork(1);
|
||||
} else {
|
||||
$client->clear_artwork(1);
|
||||
if ($client->hasLED) {
|
||||
Plugins::SqueezeESP32::RgbLed::updateLED($client, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
|
||||
@@ -70,12 +70,13 @@ sub ledVisualizerNModes {
|
||||
|
||||
sub updateLED {
|
||||
my $client = shift;
|
||||
my $on = shift || 1;
|
||||
my $cprefs = $prefs->client($client);
|
||||
|
||||
my $visu = $cprefs->get('led_visualizer') || 0;
|
||||
my $bright = $cprefs->get('led_brightness') || 20;
|
||||
|
||||
$visu = 0 if ($visu < 0 || $visu > ledVisualizerNModes || !(Slim::Player::Source::playmode($client) eq 'play'));
|
||||
$visu = 0 if ($visu < 0 || $visu > ledVisualizerNModes || !(Slim::Player::Source::playmode($client) eq 'play') || !$on);
|
||||
my $modes = ledVisualizerModes;
|
||||
my $params = $modes->[$visu]{'params'};
|
||||
my $data = pack('CCC', $params->[0], $params->[1], $bright);
|
||||
|
||||
Reference in New Issue
Block a user