Add deserialization logic
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include "fan/PwmControl.h"
|
||||
#include <boost/json/object.hpp>
|
||||
#include <fan/HwmonFan.h>
|
||||
|
||||
@@ -13,6 +14,11 @@ int HwmonFan::rpm() { return mRpmSensor->value(); }
|
||||
|
||||
json HwmonFan::toJson() const {
|
||||
json obj;
|
||||
obj["HwmonFan"] = {mPwmControl->toJson(), mRpmSensor->toJson()};
|
||||
obj = {mPwmControl->toJson(), mRpmSensor->toJson()};
|
||||
return obj;
|
||||
}
|
||||
|
||||
const string HwmonFan::toString() const {
|
||||
return "Fan!\nPwmControl: " + mPwmControl->toString() +
|
||||
"\nRpmSensor: " + mRpmSensor->toString();
|
||||
}
|
||||
|
||||
@@ -77,6 +77,6 @@ const string PwmControl::toString() const {
|
||||
}
|
||||
|
||||
json PwmControl::toJson() const {
|
||||
json obj = {"PwmControl", toString()};
|
||||
json obj = {"PwmControl", mControlPath};
|
||||
return obj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user