mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Dynamic Device Selection/Configuration (#1164)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#include "LedDeviceYeelight.h"
|
||||
#include "LedDeviceYeelight.h"
|
||||
|
||||
#include <ssdp/SSDPDiscover.h>
|
||||
#include <utils/QStringUtils.h>
|
||||
@@ -1018,10 +1018,9 @@ bool LedDeviceYeelight::init(const QJsonObject &deviceConfig)
|
||||
|
||||
//Get device specific configuration
|
||||
|
||||
bool ok;
|
||||
if ( deviceConfig[ CONFIG_COLOR_MODEL ].isString() )
|
||||
{
|
||||
_outputColorModel = deviceConfig[ CONFIG_COLOR_MODEL ].toString().toInt(&ok,MODEL_RGB);
|
||||
_outputColorModel = deviceConfig[ CONFIG_COLOR_MODEL ].toString(QString(MODEL_RGB)).toInt();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1030,7 +1029,7 @@ bool LedDeviceYeelight::init(const QJsonObject &deviceConfig)
|
||||
|
||||
if ( deviceConfig[ CONFIG_TRANS_EFFECT ].isString() )
|
||||
{
|
||||
_transitionEffect = static_cast<YeelightLight::API_EFFECT>( deviceConfig[ CONFIG_TRANS_EFFECT ].toString().toInt(&ok, YeelightLight::API_EFFECT_SMOOTH) );
|
||||
_transitionEffect = static_cast<YeelightLight::API_EFFECT>( deviceConfig[ CONFIG_TRANS_EFFECT ].toString(QString(YeelightLight::API_EFFECT_SMOOTH)).toInt() );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1047,7 +1046,7 @@ bool LedDeviceYeelight::init(const QJsonObject &deviceConfig)
|
||||
|
||||
if ( deviceConfig[ CONFIG_DEBUGLEVEL ].isString() )
|
||||
{
|
||||
_debuglevel = deviceConfig[ CONFIG_DEBUGLEVEL ].toString().toInt();
|
||||
_debuglevel = deviceConfig[ CONFIG_DEBUGLEVEL ].toString(QString("0")).toInt();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user