blob: 607a98500496c073963f313210657e83e073dadf [file] [log] [blame]
Tomáš Pecka139e3612021-01-25 19:49:00 +01001#include "Factory.h"
2#include "health/outputs/LedSysfsDriver.h"
3#include "health/outputs/SlotWrapper.h"
4#include "health/outputs/callables.h"
5
6namespace velia::health {
7boost::signals2::SlotWrapper<void, health::State> createOutput(const std::string& applianceName)
8{
9 if (applianceName == "czechlight-clearfog") {
10 return boost::signals2::SlotWrapper<void, State>(std::make_shared<LedOutputCallback>(
11 std::make_shared<LedSysfsDriver>("/sys/class/leds/status:red/"),
12 std::make_shared<LedSysfsDriver>("/sys/class/leds/status:green/"),
13 std::make_shared<LedSysfsDriver>("/sys/class/leds/status:blue/")));
14 } else {
15 throw std::runtime_error("Unknown appliance '" + applianceName + "'");
16 }
17}
18}