mirror of
https://github.com/esphome/esphome.git
synced 2024-12-25 23:14:54 +01:00
Support custom build_flags for bme680_bsec (#1678)
This commit is contained in:
parent
b53f9f2a81
commit
a39bb7b92f
3 changed files with 11 additions and 11 deletions
|
@ -60,5 +60,5 @@ def to_code(config):
|
|||
var.set_state_save_interval(config[CONF_STATE_SAVE_INTERVAL].total_milliseconds)
|
||||
)
|
||||
|
||||
cg.add_build_flag("-DUSING_BSEC")
|
||||
cg.add_define("USING_BSEC")
|
||||
cg.add_library("BSEC Software Library", "1.6.1480")
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifdef USING_BSEC
|
||||
|
||||
|
||||
#include "bme680_bsec.h"
|
||||
#include "esphome/core/log.h"
|
||||
|
@ -7,7 +7,7 @@
|
|||
|
||||
namespace esphome {
|
||||
namespace bme680_bsec {
|
||||
|
||||
#ifdef USING_BSEC
|
||||
static const char *TAG = "bme680_bsec.sensor";
|
||||
|
||||
static const std::string IAQ_ACCURACY_STATES[4] = {"Stabilizing", "Uncertain", "Calibrating", "Calibrated"};
|
||||
|
@ -391,8 +391,6 @@ void BME680BSECComponent::save_state_(uint8_t accuracy) {
|
|||
|
||||
ESP_LOGI(TAG, "Saved state");
|
||||
}
|
||||
|
||||
#endif
|
||||
} // namespace bme680_bsec
|
||||
} // namespace esphome
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#ifdef USING_BSEC
|
||||
|
||||
|
||||
#pragma once
|
||||
|
||||
|
@ -7,11 +7,15 @@
|
|||
#include "esphome/components/text_sensor/text_sensor.h"
|
||||
#include "esphome/components/i2c/i2c.h"
|
||||
#include "esphome/core/preferences.h"
|
||||
#include <bsec.h>
|
||||
#include <map>
|
||||
|
||||
#ifdef USING_BSEC
|
||||
#include <bsec.h>
|
||||
#endif
|
||||
|
||||
namespace esphome {
|
||||
namespace bme680_bsec {
|
||||
#ifdef USING_BSEC
|
||||
|
||||
enum IAQMode {
|
||||
IAQ_MODE_STATIC = 0,
|
||||
|
@ -99,8 +103,6 @@ class BME680BSECComponent : public Component, public i2c::I2CDevice {
|
|||
sensor::Sensor *co2_equivalent_sensor_;
|
||||
sensor::Sensor *breath_voc_equivalent_sensor_;
|
||||
};
|
||||
|
||||
#endif
|
||||
} // namespace bme680_bsec
|
||||
} // namespace esphome
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue