esphome/esphome/components/xiaomi_cgg1/xiaomi_cgg1.cpp
Alexander Leisentritt cdfbe5b523 refactored xiaomi sensors (#755)
* refactored xiaomi sensors

* fix lint

* fixed and added tests

* fix namespace

* LYWSD02 has no battery level

* fixed enum

* fix

* fix case

* fix spaces in empty line...

* inform users of old sensors about the change
2019-10-16 13:29:56 +02:00

21 lines
465 B
C++

#include "xiaomi_cgg1.h"
#include "esphome/core/log.h"
#ifdef ARDUINO_ARCH_ESP32
namespace esphome {
namespace xiaomi_cgg1 {
static const char *TAG = "xiaomi_cgg1";
void XiaomiCGG1::dump_config() {
ESP_LOGCONFIG(TAG, "Xiaomi CGG1");
LOG_SENSOR(" ", "Temperature", this->temperature_);
LOG_SENSOR(" ", "Humidity", this->humidity_);
LOG_SENSOR(" ", "Battery Level", this->battery_level_);
}
} // namespace xiaomi_cgg1
} // namespace esphome
#endif