esphome-ratgdo/components/ratgdo/dry_contact.h

53 lines
1.2 KiB
C
Raw Permalink Normal View History

#pragma once
#include "SoftwareSerial.h" // Using espsoftwareserial https://github.com/plerup/espsoftwareserial
#include "esphome/core/optional.h"
#include "callbacks.h"
#include "observable.h"
#include "protocol.h"
#include "ratgdo_state.h"
namespace esphome {
class Scheduler;
class InternalGPIOPin;
namespace ratgdo {
namespace dry_contact {
using namespace esphome::ratgdo::protocol;
class DryContact : public Protocol {
public:
void setup(RATGDOComponent* ratgdo, Scheduler* scheduler, InternalGPIOPin* rx_pin, InternalGPIOPin* tx_pin);
void loop();
void dump_config();
void sync();
void light_action(LightAction action);
void lock_action(LockAction action);
void door_action(DoorAction action);
2024-01-25 01:44:26 +00:00
Result call(Args args);
const Traits& traits() const { return this->traits_; }
protected:
2024-01-25 01:44:26 +00:00
void toggle_door();
Traits traits_;
InternalGPIOPin* tx_pin_;
InternalGPIOPin* rx_pin_;
RATGDOComponent* ratgdo_;
Scheduler* scheduler_;
};
} // namespace secplus1
} // namespace ratgdo
} // namespace esphome