#include "../tw7100.h" #include "tw7100_number.h" #include "esphome/core/log.h" #include "esphome/core/defines.h" #include "esphome/core/helpers.h" namespace esphome { namespace tw7100 { void tw7100Number::setup() { static const char *const TAG = "tw7100Number::setup()"; ESP_LOGV(TAG, "setup done"); } void tw7100Number::dump_config() { static const char *const TAG = "dump_config()"; ESP_LOGCONFIG(TAG, "TW7100:"); LOG_NUMBER(TAG, "tw7100Number", this); } void tw7100Number::control(float value) { static const char *const TAG = "tw7100Number::control()"; std::string param; param = std::to_string((int)value); ESP_LOGV(TAG, "%s: %s (from %i)", cmd_, param, (int)value); if (param.length() > 0 && state != value) { parent_->push_cmd(cmd_, param); ESP_LOGV("", "CMD: %s, PARAM: %s", cmd_.c_str(), param.c_str()); } publish_state(value); ESP_LOGV(TAG, "control done"); }; } // namespace tw7100 } // namespace esphome