44#include " esphome/core/log.h"
55#include < cinttypes>
66
7- #define ESP_LOG_MSG_CO2_CAL_FAIL = " Perform Forced CO₂ Calibration failed" ;
8- #define ESP_LOG_MSG_ACT_SHT_HEATER_FAIL = " Activate SHT Heater failed" ;
9- #define ESP_LOG_MSG_FAN_CLEAN_FAIL = " Fan Cleaning failed" ;
7+ #define ESP_LOG_MSG_CO2_CAL_FAIL " Perform Forced CO₂ Calibration failed" ;
8+ #define ESP_LOG_MSG_ACT_SHT_HEATER_FAIL " Activate SHT Heater failed" ;
9+ #define ESP_LOG_MSG_FAN_CLEAN_FAIL " Fan Cleaning failed" ;
1010
1111namespace esphome {
1212namespace sen5x {
@@ -139,7 +139,7 @@ void SEN5XComponent::internal_setup_(uint8_t state) {
139139 this ->mark_failed ();
140140 return ;
141141 }
142- if (this ->is_sen6x ()) {
142+ if (this ->is_sen6x_ ()) {
143143 stop_measurement_delay = 1000 ;
144144 } else {
145145 stop_measurement_delay = 200 ;
@@ -210,7 +210,7 @@ void SEN5XComponent::internal_setup_(uint8_t state) {
210210 this ->mark_failed ();
211211 return ;
212212 }
213- if (this ->is_sen6x ()) {
213+ if (this ->is_sen6x_ ()) {
214214 this ->firmware_minor_ = firmware && 0xFF ;
215215 this ->firmware_major_ = firmware >> 8 ;
216216 ESP_LOGD (TAG, " Firmware version %u.%u" , this ->firmware_major_ , this ->firmware_minor_ );
@@ -258,7 +258,7 @@ void SEN5XComponent::internal_setup_(uint8_t state) {
258258 case 7 :
259259 bool result;
260260 if (this ->auto_cleaning_interval_ .has_value ()) {
261- if (this ->is_sen6x ()) {
261+ if (this ->is_sen6x_ ()) {
262262 ESP_LOGE (TAG, " Automatic Cleaning Interval is not supported" );
263263 this ->error_code_ = UNSUPPORTED_CONF;
264264 this ->mark_failed ();
@@ -276,7 +276,7 @@ void SEN5XComponent::internal_setup_(uint8_t state) {
276276 break ;
277277 case 8 :
278278 if (this ->acceleration_mode_ .has_value ()) {
279- if (this ->is_sen6x ()) {
279+ if (this ->is_sen6x_ ()) {
280280 ESP_LOGE (TAG, " RH/T Acceleration Mode is not supported" );
281281 this ->error_code_ = UNSUPPORTED_CONF;
282282 this ->mark_failed ();
@@ -333,7 +333,7 @@ void SEN5XComponent::internal_setup_(uint8_t state) {
333333 break ;
334334 case 11 :
335335 if (this ->temperature_compensation_ .has_value ()) {
336- if (this ->model_ == SEN50 || this ->is_sen6x ()) {
336+ if (this ->model_ == SEN50 || this ->is_sen6x_ ()) {
337337 ESP_LOGE (TAG, " Temperature Compensation Parameters are not supported" );
338338 this ->error_code_ = UNSUPPORTED_CONF;
339339 this ->mark_failed ();
@@ -492,7 +492,7 @@ void SEN5XComponent::dump_config() {
492492 }
493493 ESP_LOGCONFIG (TAG, " Product Name: %s" , this ->product_name_ .c_str ());
494494 ESP_LOGCONFIG (TAG, " Serial number: %s" , this ->serial_number_ .c_str ());
495- if (this ->is_sen6x ()) {
495+ if (this ->is_sen6x_ ()) {
496496 ESP_LOGCONFIG (TAG, " Firmware version: %u.%u" , this ->firmware_major_ , this ->firmware_minor_ );
497497 } else {
498498 ESP_LOGCONFIG (TAG, " Firmware version: %u" , this ->firmware_major_ );
@@ -841,7 +841,7 @@ bool SEN5XComponent::set_ambient_pressure_compensation(float pressure_in_hpa) {
841841 }
842842}
843843
844- bool SEN5XComponent::is_sen6x () {
844+ bool SEN5XComponent::is_sen6x_ () {
845845 switch (this ->model_ .value ()) {
846846 case SEN60:
847847 case SEN63C:
@@ -858,7 +858,7 @@ bool SEN5XComponent::start_fan_cleaning() {
858858 ESP_LOGV (TAG, " Fan Cleaning started" );
859859 this ->initialized_ = false ; // prevent update from trying to read the sensors
860860 // measurements must be stopped first for certain devices
861- if (this ->is_sen6x () && !this ->stop_measurements_ ()) {
861+ if (this ->is_sen6x_ () && !this ->stop_measurements_ ()) {
862862 ESP_LOGE (TAG, ESP_LOG_MSG_FAN_CLEAN_FAIL);
863863 this ->initialized_ = true ;
864864 return false ;
@@ -900,7 +900,7 @@ bool SEN5XComponent::activate_heater() {
900900 ESP_LOGV (TAG, " Activate SHT Heater started" );
901901 this ->initialized_ = false ; // prevent update from trying to read the sensors
902902 // measurements must be stopped first for certain devices
903- if (this ->is_sen6x () && !this ->stop_measurements_ ()) {
903+ if (this ->is_sen6x_ () && !this ->stop_measurements_ ()) {
904904 ESP_LOGE (TAG, ESP_LOG_MSG_ACT_SHT_HEATER_FAIL);
905905 this ->initialized_ = true ;
906906 return false ;
0 commit comments