mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	[nau7802] fix bad blocking code (#8070)
This commit is contained in:
		| @@ -120,8 +120,6 @@ void NAU7802Sensor::complete_setup_() { | |||||||
|   // PGA stabilizer cap on output |   // PGA stabilizer cap on output | ||||||
|   i2c::I2CRegister pwr_reg = this->reg(POWER_REG); |   i2c::I2CRegister pwr_reg = this->reg(POWER_REG); | ||||||
|   pwr_reg |= POWER_PGA_CAP_EN; |   pwr_reg |= POWER_PGA_CAP_EN; | ||||||
|  |  | ||||||
|   this->setup_complete_ = true; |  | ||||||
| } | } | ||||||
|  |  | ||||||
| void NAU7802Sensor::dump_config() { | void NAU7802Sensor::dump_config() { | ||||||
| @@ -317,7 +315,5 @@ void NAU7802Sensor::update() { | |||||||
|  |  | ||||||
| bool NAU7802Sensor::is_data_ready_() { return this->reg(PU_CTRL_REG).get() & PU_CTRL_CYCLE_READY; } | bool NAU7802Sensor::is_data_ready_() { return this->reg(PU_CTRL_REG).get() & PU_CTRL_CYCLE_READY; } | ||||||
|  |  | ||||||
| bool NAU7802Sensor::can_proceed() { return this->setup_complete_; } |  | ||||||
|  |  | ||||||
| }  // namespace nau7802 | }  // namespace nau7802 | ||||||
| }  // namespace esphome | }  // namespace esphome | ||||||
|   | |||||||
| @@ -61,7 +61,6 @@ class NAU7802Sensor : public sensor::Sensor, public PollingComponent, public i2c | |||||||
|  |  | ||||||
|   void setup() override; |   void setup() override; | ||||||
|   void loop() override; |   void loop() override; | ||||||
|   bool can_proceed() override; |  | ||||||
|   void dump_config() override; |   void dump_config() override; | ||||||
|   float get_setup_priority() const override; |   float get_setup_priority() const override; | ||||||
|   void update() override; |   void update() override; | ||||||
| @@ -80,7 +79,6 @@ class NAU7802Sensor : public sensor::Sensor, public PollingComponent, public i2c | |||||||
|   int32_t offset_calibration_; |   int32_t offset_calibration_; | ||||||
|   bool offset_calibration_failed_ = false; |   bool offset_calibration_failed_ = false; | ||||||
|   bool gain_calibration_failed_ = false; |   bool gain_calibration_failed_ = false; | ||||||
|   bool setup_complete_ = false; |  | ||||||
|  |  | ||||||
|   // |   // | ||||||
|   // Config values |   // Config values | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user