ESPHome  2024.11.1
kuntze.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace kuntze {
9 
11  public:
12  void set_ph_sensor(sensor::Sensor *ph_sensor) { ph_sensor_ = ph_sensor; }
13  void set_temperature_sensor(sensor::Sensor *temperature_sensor) { temperature_sensor_ = temperature_sensor; }
14  void set_dis1_sensor(sensor::Sensor *dis1_sensor) { dis1_sensor_ = dis1_sensor; }
15  void set_dis2_sensor(sensor::Sensor *dis2_sensor) { dis2_sensor_ = dis2_sensor; }
16  void set_redox_sensor(sensor::Sensor *redox_sensor) { redox_sensor_ = redox_sensor; }
17  void set_ec_sensor(sensor::Sensor *ec_sensor) { ec_sensor_ = ec_sensor; }
18  void set_oci_sensor(sensor::Sensor *oci_sensor) { oci_sensor_ = oci_sensor; }
19 
20  void loop() override;
21  void update() override;
22 
23  void on_modbus_data(const std::vector<uint8_t> &data) override;
24 
25  void dump_config() override;
26 
27  protected:
28  int state_{0};
29  bool waiting_{false};
30  uint32_t last_send_{0};
31 
39 };
40 
41 } // namespace kuntze
42 } // namespace esphome
sensor::Sensor * ec_sensor_
Definition: kuntze.h:37
void loop() override
Definition: kuntze.cpp:62
void set_ec_sensor(sensor::Sensor *ec_sensor)
Definition: kuntze.h:17
This class simplifies creating components that periodically check a state.
Definition: component.h:283
uint32_t last_send_
Definition: kuntze.h:30
sensor::Sensor * ph_sensor_
Definition: kuntze.h:32
sensor::Sensor * temperature_sensor_
Definition: kuntze.h:33
void set_dis1_sensor(sensor::Sensor *dis1_sensor)
Definition: kuntze.h:14
void set_temperature_sensor(sensor::Sensor *temperature_sensor)
Definition: kuntze.h:13
sensor::Sensor * redox_sensor_
Definition: kuntze.h:36
void set_redox_sensor(sensor::Sensor *redox_sensor)
Definition: kuntze.h:16
void dump_config() override
Definition: kuntze.cpp:78
void update() override
Definition: kuntze.cpp:76
sensor::Sensor * dis2_sensor_
Definition: kuntze.h:35
void on_modbus_data(const std::vector< uint8_t > &data) override
Definition: kuntze.cpp:12
sensor::Sensor * dis1_sensor_
Definition: kuntze.h:34
void set_dis2_sensor(sensor::Sensor *dis2_sensor)
Definition: kuntze.h:15
sensor::Sensor * oci_sensor_
Definition: kuntze.h:38
void set_ph_sensor(sensor::Sensor *ph_sensor)
Definition: kuntze.h:12
void set_oci_sensor(sensor::Sensor *oci_sensor)
Definition: kuntze.h:18
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base-class for all sensors.
Definition: sensor.h:57