8 _logger = spdlog::get(
"console");
53 s->_change->type(SensorType::SPEED);
54 s->_change->speed(s->_second, s->_first, timeout);
65 using namespace fmt::literals;
74 json += R
"("hostname": "{}",)"_format(useName); 75 json += R"("nodename": "{}",)"_format(useName.substr(0, useName.find('.')));
83 json += R
"("{}" : {{)"_format(s->name()); 86 json += s->_first->json(
"value");
89 json += s->json(s->name());
94 std::string str = s->_change->json(
"change");
100 json += s->json(s->name());
104 if (
json.back() ==
',') {
112 if (
json.back() ==
',') {
virtual std::string json(const std::string name={}) const
ObSensor(std::string name={"sensor"})
virtual void update(unsigned int timeout) final
std::vector< ObSensor * > _sensors
List of subsensors.
ObSensor * _first
Pointer to first sensor.
bool enabled() const
Returns flag if sensor is enabled.
ObSensor * _second
Pointer to second sensor.
std::string name() const
Returns name of sensor.
std::string _name
Sensor name.
void type(SensorType t)
Sets sensor type.