diff --git a/chlorPump.yaml b/chlorPump.yaml index c5f257c..1ca6155 100644 --- a/chlorPump.yaml +++ b/chlorPump.yaml @@ -185,7 +185,7 @@ chlorine_pump: id: chlorine_pump_component disable_clock: false proportional_band: 200 - target: 650 + target: 700 # get_target: !lambda return id(chlorine_target).state; on_pump_value: - lambda: |- diff --git a/external_components/chlorine_pump/pump_cycle.h b/external_components/chlorine_pump/pump_cycle.h index 8a64a76..b663dac 100644 --- a/external_components/chlorine_pump/pump_cycle.h +++ b/external_components/chlorine_pump/pump_cycle.h @@ -1,7 +1,7 @@ #pragma once #include "esphome/core/automation.h" -#include "esphome/components/gpio/output/gpio_binary_output.h" +#include "esphome/components/output/binary_output.h" static const char *const TAG = "chlorine_pump"; @@ -12,7 +12,7 @@ class ChlorinePump : public Component { protected: sensor::Sensor *sensor_; - gpio::GPIOBinaryOutput *pump_out; + output::BinaryOutput *pump_out; int cycle_time; int prop_band; bool state = true; @@ -42,7 +42,7 @@ class ChlorinePump : public Component { void set_pump_time_divivder(float pump_time_divider){ this->tOn_divider_ = pump_time_divider; } - void set_pump_out(gpio::GPIOBinaryOutput *pump_out){ + void set_pump_out(output::BinaryOutput *pump_out){ this->pump_out = pump_out; } void set_cycle_time(int time_in_sec){ @@ -51,8 +51,8 @@ class ChlorinePump : public Component { void set_prop_band(int prop_band){ this->prop_band = prop_band; } - void set_target(int target){ - this->target_ = (float) target; + void set_target(float target){ + this->target_ = target; } void setup() override { @@ -171,7 +171,13 @@ class ChlorinePump : public Component { } void dump_config() override { - + ESP_LOGCONFIG(TAG, "Chlorine_pump controller"); + ESP_LOGCONFIG(TAG, " Ticker: %s", disable_clock_ ? "using on_value from sensor" : "using internal"); + //LOG_BINARY_OUTPUT(pump_out); + ESP_LOGCONFIG(TAG, " Cycle Time: %ds", cycle_time); + ESP_LOGCONFIG(TAG, " Proportional Band: %d", prop_band); + if(target_ != -1) ESP_LOGCONFIG(TAG, " Target: %.0fmV", target_); + else ESP_LOGCONFIG(TAG, " Target: Using get_target lambda"); } };