LedDeviceFile now defaults to /dev/null if the output is omitted.

This commit is contained in:
penfold42 2016-03-23 21:28:31 +11:00
parent 3fbc03c3fe
commit eff12ec16d
2 changed files with 2 additions and 2 deletions

View File

@ -277,7 +277,7 @@ LedDevice * LedDeviceFactory::construct(const Json::Value & deviceConfig)
}
else if (type == "file")
{
const std::string output = deviceConfig["output"].asString();
const std::string output = deviceConfig.get("output", "/dev/null").asString();
device = new LedDeviceFile(output);
}
else if (type == "fadecandy")

View File

@ -3,7 +3,7 @@
#include "LedDeviceFile.h"
LedDeviceFile::LedDeviceFile(const std::string& output) :
_ofs(output.empty()?"/home/pi/LedDevice.out":output.c_str())
_ofs(output.empty()?"/dev/null":output.c_str())
{
// empty
}