mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Differentiate between LED-Device Enable/Disable and Switch On/Off (#960)
* Switch Off devices, when no input source * Realign Enable/SwitchOn, Disable/SwitchOff * Align to updated LedDevice-Flow * Remove debug statements slipped in * Send last color update after enabling again * Fix WLED getProperties API call * Remove unused signals * LedDevice process flow documentation * LedDevice process flow documentation Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
This commit is contained in:
@@ -87,6 +87,7 @@ void Hyperion::start()
|
||||
|
||||
// connect Hyperion::update with Muxer visible priority changes as muxer updates independent
|
||||
connect(&_muxer, &PriorityMuxer::visiblePriorityChanged, this, &Hyperion::update);
|
||||
connect(&_muxer, &PriorityMuxer::visiblePriorityChanged, this, &Hyperion::handlPriorityChangedLedDevice);
|
||||
connect(&_muxer, &PriorityMuxer::visibleComponentChanged, this, &Hyperion::handleVisibleComponentChanged);
|
||||
|
||||
// listens for ComponentRegister changes of COMP_ALL to perform core enable/disable actions
|
||||
@@ -530,6 +531,26 @@ void Hyperion::handleVisibleComponentChanged(hyperion::Components comp)
|
||||
_raw2ledAdjustment->setBacklightEnabled((comp != hyperion::COMP_COLOR && comp != hyperion::COMP_EFFECT));
|
||||
}
|
||||
|
||||
void Hyperion::handlPriorityChangedLedDevice(const quint8& priority)
|
||||
{
|
||||
quint8 previousPriority = _muxer.getPreviousPriority();
|
||||
|
||||
Debug(_log,"priority[%u], previousPriority[%u]", priority, previousPriority);
|
||||
if ( priority == PriorityMuxer::LOWEST_PRIORITY)
|
||||
{
|
||||
Debug(_log,"No source left -> switch LED-Device off");
|
||||
emit _ledDeviceWrapper->switchOff();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( previousPriority == PriorityMuxer::LOWEST_PRIORITY )
|
||||
{
|
||||
Debug(_log,"new source available -> switch LED-Device on");
|
||||
emit _ledDeviceWrapper->switchOn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Hyperion::update()
|
||||
{
|
||||
// Obtain the current priority channel
|
||||
|
Reference in New Issue
Block a user