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:
LordGrey
2020-09-14 17:19:14 +02:00
committed by GitHub
parent fbd8167458
commit 4aabe175cd
15 changed files with 247 additions and 146 deletions

View File

@@ -18,6 +18,7 @@ PriorityMuxer::PriorityMuxer(int ledCount, QObject * parent)
: QObject(parent)
, _log(Logger::getInstance("HYPERION"))
, _currentPriority(PriorityMuxer::LOWEST_PRIORITY)
, _previousPriority(_currentPriority)
, _manualSelectedPriority(256)
, _activeInputs()
, _lowestPriorityInfo()
@@ -156,7 +157,6 @@ void PriorityMuxer::registerInput(int priority, hyperion::Components component,
if(newInput)
{
Debug(_log,"Register new input '%s/%s' with priority %d as inactive", QSTRING_CSTR(origin), hyperion::componentToIdString(component), priority);
emit priorityChanged(priority, true);
emit prioritiesChanged();
return;
}
@@ -255,7 +255,6 @@ bool PriorityMuxer::clearInput(uint8_t priority)
Debug(_log,"Removed source priority %d",priority);
// on clear success update _currentPriority
setCurrentTime();
emit priorityChanged(priority, false);
emit prioritiesChanged();
return true;
}
@@ -266,6 +265,7 @@ void PriorityMuxer::clearAll(bool forceClearAll)
{
if (forceClearAll)
{
_previousPriority = _currentPriority;
_activeInputs.clear();
_currentPriority = PriorityMuxer::LOWEST_PRIORITY;
_activeInputs[_currentPriority] = _lowestPriorityInfo;
@@ -296,7 +296,6 @@ void PriorityMuxer::setCurrentTime()
quint8 tPrio = infoIt->priority;
infoIt = _activeInputs.erase(infoIt);
Debug(_log,"Timeout clear for priority %d",tPrio);
emit priorityChanged(tPrio, false);
emit prioritiesChanged();
}
else
@@ -329,6 +328,7 @@ void PriorityMuxer::setCurrentTime()
// apply & emit on change (after apply!)
if (_currentPriority != newPriority)
{
_previousPriority = _currentPriority;
_currentPriority = newPriority;
Debug(_log, "Set visible priority to %d", newPriority);
emit visiblePriorityChanged(newPriority);