mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-06 04:48:27 +02:00
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
This commit is contained in:
committed by
Otto Winter
parent
cdb9c59662
commit
cdfbe5b523
@@ -0,0 +1,21 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user