mirror of
https://github.com/esphome/esphome.git
synced 2025-07-29 06:36:45 +00:00
This commit is contained in:
parent
b98165e077
commit
ff406f8e11
@ -50,8 +50,8 @@ void MAX7219Component::setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MAX7219Component::dump_config() {
|
void MAX7219Component::dump_config() {
|
||||||
ESP_LOGCONFIG(TAG, "MAX7219DIGIT:");
|
|
||||||
ESP_LOGCONFIG(TAG,
|
ESP_LOGCONFIG(TAG,
|
||||||
|
"MAX7219DIGIT:\n"
|
||||||
" Number of Chips: %u\n"
|
" Number of Chips: %u\n"
|
||||||
" Number of Chips Lines: %u\n"
|
" Number of Chips Lines: %u\n"
|
||||||
" Chips Lines Style : %u\n"
|
" Chips Lines Style : %u\n"
|
||||||
|
@ -11,13 +11,13 @@ static const char *const TAG = "servo";
|
|||||||
uint32_t global_servo_id = 1911044085ULL; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
uint32_t global_servo_id = 1911044085ULL; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||||
|
|
||||||
void Servo::dump_config() {
|
void Servo::dump_config() {
|
||||||
ESP_LOGCONFIG(TAG, "Servo:");
|
|
||||||
ESP_LOGCONFIG(TAG,
|
ESP_LOGCONFIG(TAG,
|
||||||
|
"Servo:\n"
|
||||||
" Idle Level: %.1f%%\n"
|
" Idle Level: %.1f%%\n"
|
||||||
" Min Level: %.1f%%\n"
|
" Min Level: %.1f%%\n"
|
||||||
" Max Level: %.1f%%\n"
|
" Max Level: %.1f%%\n"
|
||||||
" auto detach time: %" PRIu32 " ms\n"
|
" Auto-detach time: %" PRIu32 " ms\n"
|
||||||
" run duration: %" PRIu32 " ms",
|
" Run duration: %" PRIu32 " ms",
|
||||||
this->idle_level_ * 100.0f, this->min_level_ * 100.0f, this->max_level_ * 100.0f,
|
this->idle_level_ * 100.0f, this->min_level_ * 100.0f, this->max_level_ * 100.0f,
|
||||||
this->auto_detach_time_, this->transition_length_);
|
this->auto_detach_time_, this->transition_length_);
|
||||||
}
|
}
|
||||||
@ -44,7 +44,7 @@ void Servo::loop() {
|
|||||||
if (millis() - this->start_millis_ > this->auto_detach_time_) {
|
if (millis() - this->start_millis_ > this->auto_detach_time_) {
|
||||||
this->detach();
|
this->detach();
|
||||||
this->start_millis_ = 0;
|
this->start_millis_ = 0;
|
||||||
ESP_LOGD(TAG, "Servo detached on auto_detach_time");
|
ESP_LOGD(TAG, "Detached on auto_detach_time");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this->target_value_ != this->current_value_ && this->state_ == STATE_ATTACHED) {
|
if (this->target_value_ != this->current_value_ && this->state_ == STATE_ATTACHED) {
|
||||||
@ -66,7 +66,7 @@ void Servo::loop() {
|
|||||||
if (this->target_value_ == this->current_value_ && this->state_ == STATE_ATTACHED) {
|
if (this->target_value_ == this->current_value_ && this->state_ == STATE_ATTACHED) {
|
||||||
this->state_ = STATE_TARGET_REACHED;
|
this->state_ = STATE_TARGET_REACHED;
|
||||||
this->start_millis_ = millis(); // set current stamp for potential auto_detach_time_ check
|
this->start_millis_ = millis(); // set current stamp for potential auto_detach_time_ check
|
||||||
ESP_LOGD(TAG, "Servo reached target");
|
ESP_LOGD(TAG, "Reached target");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ void Servo::write(float value) {
|
|||||||
this->source_value_ = this->current_value_;
|
this->source_value_ = this->current_value_;
|
||||||
this->state_ = STATE_ATTACHED;
|
this->state_ = STATE_ATTACHED;
|
||||||
this->start_millis_ = millis();
|
this->start_millis_ = millis();
|
||||||
ESP_LOGD(TAG, "Servo new target: %f", value);
|
ESP_LOGD(TAG, "New target: %f", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Servo::internal_write(float value) {
|
void Servo::internal_write(float value) {
|
||||||
|
@ -119,15 +119,16 @@ void TSL2591Component::dump_config() {
|
|||||||
gain_word = "auto";
|
gain_word = "auto";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ESP_LOGCONFIG(TAG, " Gain: %dx (%s)", gain, gain_word.c_str());
|
|
||||||
TSL2591IntegrationTime raw_timing = this->integration_time_;
|
TSL2591IntegrationTime raw_timing = this->integration_time_;
|
||||||
int timing_ms = (1 + raw_timing) * 100;
|
int timing_ms = (1 + raw_timing) * 100;
|
||||||
ESP_LOGCONFIG(TAG, " Integration Time: %d ms", timing_ms);
|
|
||||||
ESP_LOGCONFIG(TAG,
|
ESP_LOGCONFIG(TAG,
|
||||||
|
" Gain: %dx (%s)"
|
||||||
|
" Integration Time: %d ms\n"
|
||||||
" Power save mode enabled: %s\n"
|
" Power save mode enabled: %s\n"
|
||||||
" Device factor: %f\n"
|
" Device factor: %f\n"
|
||||||
" Glass attenuation factor: %f",
|
" Glass attenuation factor: %f",
|
||||||
ONOFF(this->power_save_mode_enabled_), this->device_factor_, this->glass_attenuation_factor_);
|
gain, gain_word.c_str(), timing_ms, ONOFF(this->power_save_mode_enabled_), this->device_factor_,
|
||||||
|
this->glass_attenuation_factor_);
|
||||||
LOG_SENSOR(" ", "Full spectrum:", this->full_spectrum_sensor_);
|
LOG_SENSOR(" ", "Full spectrum:", this->full_spectrum_sensor_);
|
||||||
LOG_SENSOR(" ", "Infrared:", this->infrared_sensor_);
|
LOG_SENSOR(" ", "Infrared:", this->infrared_sensor_);
|
||||||
LOG_SENSOR(" ", "Visible:", this->visible_sensor_);
|
LOG_SENSOR(" ", "Visible:", this->visible_sensor_);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user