1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-19 11:42:20 +01:00

Sun support (#531)

* Sun

* Add sun support

* Lint

* Updates

* Fix elevation

* Lint

* Update mqtt_climate.cpp
This commit is contained in:
Otto Winter
2019-05-11 12:31:00 +02:00
committed by GitHub
parent f2540bae23
commit f1a0e5a313
22 changed files with 740 additions and 66 deletions

View File

@@ -88,10 +88,8 @@ std::string Sensor::unique_id() { return ""; }
void Sensor::internal_send_state_to_frontend(float state) {
this->has_state_ = true;
this->state = state;
if (this->filter_list_ != nullptr) {
ESP_LOGD(TAG, "'%s': Sending state %.5f %s with %d decimals of accuracy", this->get_name().c_str(), state,
this->get_unit_of_measurement().c_str(), this->get_accuracy_decimals());
}
ESP_LOGD(TAG, "'%s': Sending state %.5f %s with %d decimals of accuracy", this->get_name().c_str(), state,
this->get_unit_of_measurement().c_str(), this->get_accuracy_decimals());
this->callback_.call(state);
}
bool Sensor::has_state() const { return this->has_state_; }