#pragma once #include #include class ContactSensor: public TinySensor { SensorType sensorType = CONTACT; public: ContactSensor(short id, short senderPin) : TinySensor(id, senderPin) { } void sendStateAndVoltage(bool state) { sendInfo(ID(id) | VCC(readVcc()) | STATE(!state) | TYPE(sensorType)); } void sendState(bool state) { sendInfo(ID(id) | VCC(0) | STATE(!state) | TYPE(sensorType)); } };