Compare commits
11 Commits
31fa0e8082
...
fbf979cab9
Author | SHA1 | Date |
---|---|---|
Paul Wieland | fbf979cab9 | |
Paul Wieland | 0cbb3722ae | |
Paul Wieland | 1ba198e286 | |
Paul Wieland | 4578097306 | |
Paul Wieland | da0776ff12 | |
Paul Wieland | f72cea2e8b | |
Paul Wieland | 93383489c3 | |
Paul Wieland | 7362f46aca | |
Paul Wieland | 705f381a12 | |
Paul Wieland | e3eacef44d | |
rlowens | 471e78a8e9 |
|
@ -9,6 +9,10 @@ external_components:
|
|||
preferences:
|
||||
flash_write_interval: 1min
|
||||
|
||||
text_sensor:
|
||||
- platform: version
|
||||
name: "Firmware Version"
|
||||
|
||||
ratgdo:
|
||||
id: ${id_prefix}
|
||||
input_gdo_pin: ${uart_rx_pin}
|
||||
|
|
|
@ -9,6 +9,10 @@ external_components:
|
|||
preferences:
|
||||
flash_write_interval: 1min
|
||||
|
||||
text_sensor:
|
||||
- platform: version
|
||||
name: "Firmware Version"
|
||||
|
||||
ratgdo:
|
||||
id: ${id_prefix}
|
||||
input_gdo_pin: ${uart_rx_pin}
|
||||
|
|
|
@ -102,9 +102,10 @@ namespace ratgdo {
|
|||
virtual void dump_config();
|
||||
|
||||
virtual void sync();
|
||||
|
||||
// dry contact methods
|
||||
virtual void set_open_limit(bool);
|
||||
virtual void set_close_limit(bool);
|
||||
|
||||
virtual void set_discrete_open_pin(InternalGPIOPin* pin);
|
||||
virtual void set_discrete_close_pin(InternalGPIOPin* pin);
|
||||
|
||||
|
|
|
@ -52,6 +52,11 @@ namespace ratgdo {
|
|||
|
||||
// many things happening at startup, use some delay for sync
|
||||
set_timeout(SYNC_DELAY, [=] { this->sync(); });
|
||||
ESP_LOGD(TAG, " _____ _____ _____ _____ ____ _____ ");
|
||||
ESP_LOGD(TAG, "| __ | _ |_ _| __| \\| |");
|
||||
ESP_LOGD(TAG, "| -| | | | | | | | | | |");
|
||||
ESP_LOGD(TAG, "|__|__|__|__| |_| |_____|____/|_____|");
|
||||
ESP_LOGD(TAG, "https://paulwieland.github.io/ratgdo/");
|
||||
}
|
||||
|
||||
// initializing protocol, this gets called before setup() because
|
||||
|
@ -418,16 +423,14 @@ namespace ratgdo {
|
|||
void RATGDOComponent::sync()
|
||||
{
|
||||
this->protocol_->sync();
|
||||
}
|
||||
|
||||
void RATGDOComponent::set_open_limit(bool state)
|
||||
{
|
||||
this->protocol_->set_open_limit(state);
|
||||
}
|
||||
|
||||
void RATGDOComponent::set_close_limit(bool state)
|
||||
{
|
||||
this->protocol_->set_close_limit(state);
|
||||
// dry contact protocol:
|
||||
// needed to trigger the intial state of the limit switch sensors
|
||||
// ideally this would be in drycontact::sync
|
||||
#ifdef PROTOCOL_DRYCONTACT
|
||||
this->protocol_->set_open_limit(this->dry_contact_open_sensor_->state);
|
||||
this->protocol_->set_close_limit(this->dry_contact_close_sensor_->state);
|
||||
#endif
|
||||
}
|
||||
|
||||
void RATGDOComponent::door_open()
|
||||
|
@ -683,21 +686,23 @@ namespace ratgdo {
|
|||
this->learn_state.subscribe([=](LearnState state) { defer("learn_state", [=] { f(state); }); });
|
||||
}
|
||||
|
||||
// dry contact methods
|
||||
void RATGDOComponent::set_dry_contact_open_sensor(esphome::gpio::GPIOBinarySensor* dry_contact_open_sensor)
|
||||
{
|
||||
dry_contact_open_sensor_ = dry_contact_open_sensor;
|
||||
dry_contact_open_sensor_->add_on_state_callback([this](bool sensor_value)
|
||||
{
|
||||
this->set_open_limit(sensor_value);
|
||||
this->protocol_->set_open_limit(sensor_value);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
void RATGDOComponent::set_dry_contact_close_sensor(esphome::gpio::GPIOBinarySensor* dry_contact_close_sensor)
|
||||
{
|
||||
dry_contact_close_sensor_ = dry_contact_close_sensor;
|
||||
dry_contact_close_sensor_->add_on_state_callback([this](bool sensor_value)
|
||||
{
|
||||
this->set_close_limit(sensor_value);
|
||||
this->protocol_->set_close_limit(sensor_value);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -92,9 +92,9 @@ namespace ratgdo {
|
|||
void set_input_gdo_pin(InternalGPIOPin* pin) { this->input_gdo_pin_ = pin; }
|
||||
void set_input_obst_pin(InternalGPIOPin* pin) { this->input_obst_pin_ = pin; }
|
||||
|
||||
// dry contact methods
|
||||
void set_dry_contact_open_sensor(esphome::gpio::GPIOBinarySensor* dry_contact_open_sensor_);
|
||||
void set_dry_contact_close_sensor(esphome::gpio::GPIOBinarySensor* dry_contact_close_sensor_);
|
||||
|
||||
void set_discrete_open_pin(InternalGPIOPin* pin){ this->protocol_->set_discrete_open_pin(pin); }
|
||||
void set_discrete_close_pin(InternalGPIOPin* pin){ this->protocol_->set_discrete_close_pin(pin); }
|
||||
|
||||
|
@ -152,8 +152,6 @@ namespace ratgdo {
|
|||
void query_status();
|
||||
void query_openings();
|
||||
void sync();
|
||||
void set_open_limit(bool);
|
||||
void set_close_limit(bool);
|
||||
|
||||
// children subscriptions
|
||||
void subscribe_rolling_code_counter(std::function<void(uint32_t)>&& f);
|
||||
|
|
|
@ -96,6 +96,13 @@ namespace ratgdo {
|
|||
|
||||
const Traits& traits() const { return this->traits_; }
|
||||
|
||||
// methods not used by secplus1
|
||||
void set_open_limit(bool state){}
|
||||
void set_close_limit(bool state){}
|
||||
void set_discrete_open_pin(InternalGPIOPin* pin){}
|
||||
void set_discrete_close_pin(InternalGPIOPin* pin){}
|
||||
|
||||
|
||||
protected:
|
||||
void wall_panel_emulation(size_t index = 0);
|
||||
|
||||
|
|
|
@ -101,6 +101,12 @@ namespace ratgdo {
|
|||
|
||||
const Traits& traits() const { return this->traits_; }
|
||||
|
||||
// methods not used by secplus2
|
||||
void set_open_limit(bool state){}
|
||||
void set_close_limit(bool state){}
|
||||
void set_discrete_open_pin(InternalGPIOPin* pin){}
|
||||
void set_discrete_close_pin(InternalGPIOPin* pin){}
|
||||
|
||||
protected:
|
||||
void increment_rolling_code_counter(int delta = 1);
|
||||
void set_rolling_code_counter(uint32_t counter);
|
||||
|
|
|
@ -22,7 +22,7 @@ esphome:
|
|||
version: "2.5"
|
||||
|
||||
esp8266:
|
||||
board: d1_mini_lite
|
||||
board: d1_mini
|
||||
restore_from_flash: true
|
||||
|
||||
dashboard_import:
|
||||
|
|
Loading…
Reference in New Issue