roo_control
API Documentation for roo_control
Loading...
Searching...
No Matches
bound_thermometer.h
Go to the documentation of this file.
1#pragma once
2
4#include "roo_transceivers/binding/binding.h"
5
6namespace roo_control {
7
8/// Thermometer backed by a bound sensor from roo_transceivers.
10 public:
11 BoundThermometer(roo_transceivers::Universe& universe,
12 const roo_transceivers::SensorBinding* binding)
13 : bound_sensor_(universe, binding) {}
14
15 Reading readTemperature() const override {
16 roo_transceivers::Measurement m = bound_sensor_.read();
17 if (m.isDefined()) {
19 }
20 return Reading{.value = roo_quantity::TemperatureDegCelcius(m.value()),
21 .time = m.time()};
22 }
23
24 private:
25 roo_transceivers::BoundSensor bound_sensor_;
26};
27
28} // namespace roo_control
Thermometer backed by a bound sensor from roo_transceivers.
Reading readTemperature() const override
Returns the latest available temperature reading.
BoundThermometer(roo_transceivers::Universe &universe, const roo_transceivers::SensorBinding *binding)
An abstraction of a multi-state settable switch.
Definition switch.h:24
An abstraction of a thermometer, i.e., a device that reports temperature.
Definition thermometer.h:10
Captures a temperature measured at a specific time.
Definition thermometer.h:13
roo_quantity::Temperature value
Measured temperature value.
Definition thermometer.h:15