mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Update Hyperion.cpp
Former-commit-id: 24638e6009da0dc3a2168caef53e09664c1db095
This commit is contained in:
parent
88e4737b8b
commit
63e3380ff7
@ -455,6 +455,37 @@ LedDevice * Hyperion::createColorSmoothing(const Json::Value & smoothingConfig,
|
|||||||
return ledDevice;
|
return ledDevice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MessageForwarder * Hyperion::createMessageForwarder(const Json::Value & forwarderConfig)
|
||||||
|
{
|
||||||
|
MessageForwarder * forwarder = new MessageForwarder();
|
||||||
|
if ( ! forwarderConfig.isNull() )
|
||||||
|
{
|
||||||
|
if ( ! forwarderConfig["json"].isNull() && forwarderConfig["json"].isArray() )
|
||||||
|
{
|
||||||
|
for (const Json::Value& addr : forwarderConfig["json"])
|
||||||
|
{
|
||||||
|
std::cout << "Json forward to " << addr.asString() << std::endl;
|
||||||
|
forwarder->addJsonSlave(addr.asString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! forwarderConfig["proto"].isNull() && forwarderConfig["proto"].isArray() )
|
||||||
|
{
|
||||||
|
for (const Json::Value& addr : forwarderConfig["proto"])
|
||||||
|
{
|
||||||
|
std::cout << "Proto forward to " << addr.asString() << std::endl;
|
||||||
|
forwarder->addProtoSlave(addr.asString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return forwarder;
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageForwarder * Hyperion::getForwarder()
|
||||||
|
{
|
||||||
|
return _messageForwarder;
|
||||||
|
}
|
||||||
|
|
||||||
Hyperion::Hyperion(const Json::Value &jsonConfig) :
|
Hyperion::Hyperion(const Json::Value &jsonConfig) :
|
||||||
_ledString(createLedString(jsonConfig["leds"], createColorOrder(jsonConfig["device"]))),
|
_ledString(createLedString(jsonConfig["leds"], createColorOrder(jsonConfig["device"]))),
|
||||||
@ -519,6 +550,9 @@ Hyperion::~Hyperion()
|
|||||||
|
|
||||||
// delete the color temperature correction
|
// delete the color temperature correction
|
||||||
delete _raw2ledTemperature;
|
delete _raw2ledTemperature;
|
||||||
|
|
||||||
|
// delete the message forwarder
|
||||||
|
delete _messageForwarder;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned Hyperion::getLedCount() const
|
unsigned Hyperion::getLedCount() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user