#pragma once

#include <TinySensor.h>
#include <RCSwitch.h>

#define ID(value) (value & 0x1F)
#define VCC(value) ((value & 0x1FFF) << 6)
#define TEMP(value) (((unsigned long)value & 0x1FF) << 19)

class TempSensor: public TinySensor {

public:
	TempSensor(short id, short senderPin) :
			TinySensor(id, senderPin) {
	}

	void sendTempAndVoltage(int temp) {
		sendInfo(ID(id) | VCC(readVcc()) | TEMP(temp) | TYPE(6));
	}
};
