rc-gateway/libraries/Tiny/TemperatureSensor.h

21 lines
381 B
C++

#pragma once
#include <TinySensor.h>
class TemperatureSensor : public TinySensor {
SensorType sensorType = TEMPERATURE;
public:
TemperatureSensor(short 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));
}
};