mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Allow to switch on LED device, if currently disabled
This commit is contained in:
parent
bea8345e4b
commit
61bffa6dd8
@ -45,12 +45,22 @@ void LedDevice::setEnable(bool enable)
|
||||
{
|
||||
// emit signal when state changed
|
||||
if (_enabled != enable)
|
||||
{
|
||||
emit enableStateChanged(enable);
|
||||
|
||||
// set black to leds when they should go off
|
||||
}
|
||||
// switch off device when disabled, default: set black to leds when they should go off
|
||||
if ( _enabled && !enable)
|
||||
{
|
||||
switchOff();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// switch on device when enabled
|
||||
if ( !_enabled && enable)
|
||||
{
|
||||
switchOn();
|
||||
}
|
||||
}
|
||||
_enabled = enable;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user