Added config options for username and transitiontime

Former-commit-id: 2ae179c670fda838115d985f40d970e10ef002ef
This commit is contained in:
Tim Niggemann
2015-02-01 15:29:40 +01:00
parent d106a9645c
commit 9d506b888d
3 changed files with 21 additions and 7 deletions

View File

@@ -192,8 +192,10 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
else if (type == "philipshue")
{
const std::string output = deviceConfig["output"].asString();
const std::string username = deviceConfig.get("username", "newdeveloper").asString();
const bool switchOffOnBlack = deviceConfig.get("switchOffOnBlack", true).asBool();
device = new LedDevicePhilipsHue(output, switchOffOnBlack);
const int transitiontime = deviceConfig.get("transitiontime", 4).asInt();
device = new LedDevicePhilipsHue(output, username, switchOffOnBlack, transitiontime);
}
else if (type == "test")
{