hydreon_rgxx - fix missing cg.add(var.set_model(...)) (#6065)

This commit is contained in:
mrtoy-me 2024-01-11 16:18:22 +10:00 committed by GitHub
parent d616025fed
commit 4cc17dac0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -17,6 +17,12 @@ void HydreonRGxxComponent::dump_config() {
if (this->is_failed()) { if (this->is_failed()) {
ESP_LOGE(TAG, "Connection with hydreon_rgxx failed!"); ESP_LOGE(TAG, "Connection with hydreon_rgxx failed!");
} }
if (model_ == RG9) {
ESP_LOGCONFIG(TAG, " Model: RG9");
ESP_LOGCONFIG(TAG, " Disable Led: %s", TRUEFALSE(this->disable_led_));
} else {
ESP_LOGCONFIG(TAG, " Model: RG15");
}
LOG_UPDATE_INTERVAL(this); LOG_UPDATE_INTERVAL(this);
int i = 0; int i = 0;
@ -25,10 +31,6 @@ void HydreonRGxxComponent::dump_config() {
LOG_SENSOR(" ", #s, this->sensors_[i - 1]); \ LOG_SENSOR(" ", #s, this->sensors_[i - 1]); \
} }
HYDREON_RGXX_PROTOCOL_LIST(HYDREON_RGXX_LOG_SENSOR, ); HYDREON_RGXX_PROTOCOL_LIST(HYDREON_RGXX_LOG_SENSOR, );
if (this->model_ == RG9) {
ESP_LOGCONFIG(TAG, "disable_led: %s", TRUEFALSE(this->disable_led_));
}
} }
void HydreonRGxxComponent::setup() { void HydreonRGxxComponent::setup() {

View file

@ -138,6 +138,7 @@ async def to_code(config):
sens = await sensor.new_sensor(config[conf]) sens = await sensor.new_sensor(config[conf])
cg.add(var.set_sensor(sens, i)) cg.add(var.set_sensor(sens, i))
cg.add(var.set_model(config[CONF_MODEL]))
cg.add(var.set_request_temperature(CONF_TEMPERATURE in config)) cg.add(var.set_request_temperature(CONF_TEMPERATURE in config))
if CONF_DISABLE_LED in config: if CONF_DISABLE_LED in config: