Added light ids to device config.

Former-commit-id: 601616b0d7509b0e8ebb5226f00af5028fa905b5
This commit is contained in:
Tim Niggemann
2015-03-03 15:45:09 +01:00
parent acc0f61e60
commit ecea6e55ea
3 changed files with 21 additions and 6 deletions

View File

@@ -196,7 +196,11 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
const std::string username = deviceConfig.get("username", "newdeveloper").asString();
const bool switchOffOnBlack = deviceConfig.get("switchOffOnBlack", true).asBool();
const int transitiontime = deviceConfig.get("transitiontime", 1).asInt();
device = new LedDevicePhilipsHue(output, username, switchOffOnBlack, transitiontime);
std::vector<unsigned int> lightIds;
for (size_t i = 0; i < deviceConfig["lightIds"].size(); i++) {
lightIds.push_back(deviceConfig["lightIds"][i].asInt());
}
device = new LedDevicePhilipsHue(output, username, switchOffOnBlack, transitiontime, lightIds);
}
else if (type == "test")
{