Skip to content

Commit

Permalink
Add delay_time
Browse files Browse the repository at this point in the history
  • Loading branch information
netmindz committed Nov 3, 2023
1 parent acd95ef commit 03ba436
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/BalboaGL/ESPBalboaGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,7 @@ void BalboaGL::set_rts_pin(int pin) {
void BalboaGL::set_panel_select_pin(int pin) {
this->panel_select_pin = pin;
}

void BalboaGL::set_delay_time(int delay) {
this->spa->set_delay_time(delay);
}
2 changes: 2 additions & 0 deletions components/BalboaGL/ESPBalboaGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class BalboaGL : public Component {

void set_panel_select_pin(int pin);

void set_delay_time(int delay);

float get_setup_priority() const override { return esphome::setup_priority::AFTER_WIFI; }

void pause();
Expand Down
6 changes: 6 additions & 0 deletions components/BalboaGL/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
CONF_ENABLE_PIN = "enable_pin"
CONF_PANEL_SELECT_PIN = "panel_select_pin"

CONF_DELAY_TIME = "delay_time"

balboagl_ns = cg.esphome_ns.namespace("balboagl")
BalboaGL = cg.global_ns.class_(
"BalboaGL", cg.Component
Expand Down Expand Up @@ -50,6 +52,7 @@ def valid_uart(uart):
cv.Required(CONF_TX_PIN): cv.int_range(),
cv.Required(CONF_PANEL_SELECT_PIN): cv.int_range(),
cv.Optional(CONF_ENABLE_PIN): cv.int_range(),
cv.Optional(CONF_DELAY_TIME): cv.int_range(),
# Optionally override the supported ClimateTraits.
cv.Optional(CONF_SUPPORTS, default={}): cv.Schema(
{
Expand Down Expand Up @@ -78,6 +81,9 @@ def to_code(config):
if CONF_PANEL_SELECT_PIN in config:
cg.add(var.set_panel_select_pin(config[CONF_PANEL_SELECT_PIN]))

if CONF_DELAY_TIME in config:
cg.add(var.set_delay_time(config[CONF_DELAY_TIME]))


yield cg.register_component(var, config)

Expand Down

0 comments on commit 03ba436

Please sign in to comment.