1
0
mirror of https://github.com/esphome/esphome.git synced 2025-01-22 05:44:04 +00:00
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

22 lines
489 B
C++

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