1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-22 04:48:21 +00:00
esphome/esphome/components/version/version_text_sensor.cpp
Otto Winter ebe64e24f1
Move ESPHome version define (#607)
* Move ESPHome version define

* Lint
2019-06-03 16:07:15 +02:00

19 lines
646 B
C++

#include "version_text_sensor.h"
#include "esphome/core/log.h"
#include "esphome/core/application.h"
#include "esphome/core/version.h"
namespace esphome {
namespace version {
static const char *TAG = "version.text_sensor";
void VersionTextSensor::setup() { this->publish_state(ESPHOME_VERSION " " + App.get_compilation_time()); }
float VersionTextSensor::get_setup_priority() const { return setup_priority::DATA; }
std::string VersionTextSensor::unique_id() { return get_mac_address() + "-version"; }
void VersionTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Version Text Sensor", this); }
} // namespace version
} // namespace esphome