mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
add ability for default values in providerudp (#251)
* add ability for default values in providerudp * udp: move switchOff into baseclass * udp: more code cleanups
This commit is contained in:
@@ -16,16 +16,14 @@
|
||||
#include "LedDeviceUdpE131.h"
|
||||
|
||||
LedDeviceUdpE131::LedDeviceUdpE131(const Json::Value &deviceConfig)
|
||||
: ProviderUdp(deviceConfig)
|
||||
|
||||
: ProviderUdp()
|
||||
{
|
||||
setConfig(deviceConfig);
|
||||
}
|
||||
|
||||
bool LedDeviceUdpE131::setConfig(const Json::Value &deviceConfig)
|
||||
{
|
||||
ProviderUdp::setConfig(deviceConfig);
|
||||
_LatchTime_ns = deviceConfig.get("latchtime",104000).asInt();
|
||||
ProviderUdp::setConfig(deviceConfig, 104000, 5568);
|
||||
_e131_universe = deviceConfig.get("universe",1).asInt();
|
||||
_e131_source_name = deviceConfig.get("source-name","hyperion on "+QHostInfo::localHostName().toStdString()).asString();
|
||||
QString _json_cid = QString::fromStdString(deviceConfig.get("cid","").asString());
|
||||
@@ -129,7 +127,3 @@ int LedDeviceUdpE131::write(const std::vector<ColorRgb> &ledValues)
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int LedDeviceUdpE131::switchOff()
|
||||
{
|
||||
return write(std::vector<ColorRgb>(_ledCount, ColorRgb{0,0,0}));
|
||||
}
|
||||
|
Reference in New Issue
Block a user