rc-gateway/lib/Tiny/TemperatureSensor.h

19 lines
380 B
C++

#pragma once
#include <TinySensor.h>
class TemperatureSensor : public TinySensor {
SensorType sensorType = TEMPERATURE;
public:
TemperatureSensor(SensorId id) : TinySensor(id) {}
void sendTempAndVoltage(int temp) {
sendInfo(ID(id) | VCC(readVcc()) | TEMP(temp) | TYPE(sensorType));
}
void sendTemp(int temp) {
sendInfo(ID(id) | TEMP(temp) | TYPE(sensorType));
}
};