Skip to content

Commit

Permalink
Set empty default value for LogFilter and CustomRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
wrfz committed Sep 10, 2024
1 parent 76c7015 commit 4a274de
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
8 changes: 8 additions & 0 deletions components/daikin_rotex_can/texts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@
namespace esphome {
namespace daikin_rotex_can {

LogFilterText::LogFilterText() {
this->publish_state("");
}

void LogFilterText::control(const std::string &value) {
this->publish_state(value);
Utils::g_log_filter = value;
}

CustomRequestText::CustomRequestText() {
this->publish_state("");
}

void CustomRequestText::control(const std::string &value) {
this->publish_state(value);
this->parent_->custom_request(value);
Expand Down
4 changes: 2 additions & 2 deletions components/daikin_rotex_can/texts.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ namespace daikin_rotex_can {

class LogFilterText : public text::Text, public Parented<DaikinRotexCanComponent> {
public:
LogFilterText() = default;
LogFilterText();
protected:
void control(const std::string &value) override;
};
class CustomRequestText : public text::Text, public Parented<DaikinRotexCanComponent> {
public:
CustomRequestText() = default;
CustomRequestText();
protected:
void control(const std::string &value) override;
};
Expand Down
7 changes: 4 additions & 3 deletions examples/full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ esphome:
platformio_options:
build_unflags:
- "-std=gnu++11"
- "-fno-exceptions"
- "-fno-rtti"
build_flags:
- "-std=gnu++17"
- "-fexceptions"

esp32:
board: esp32-s3-devkitc-1
Expand Down Expand Up @@ -52,6 +51,8 @@ daikin_rotex_can:
canbus_id: can_bus
log_filter:
name: "Log Filter"
custom_request:
name: "Custom Request"
entities:
bypass_valve:
name: "BPV"
Expand Down Expand Up @@ -134,4 +135,4 @@ daikin_rotex_can:
thermal_power:
name: "Thermische Leistung"
total_energy_produced:
name: "Erzeugte Energie Gesamt"
name: "Erzeugte Energie Gesamt"

0 comments on commit 4a274de

Please sign in to comment.