mirror of
https://github.com/esphome/esphome.git
synced 2024-12-13 08:54:54 +01:00
Add text_align_to_string
Used for debugging ESP_LOGCONFIG purposes
This commit is contained in:
parent
d663e453a1
commit
982942a512
2 changed files with 34 additions and 0 deletions
|
@ -416,5 +416,36 @@ void DisplayPage::set_prev(DisplayPage *prev) { this->prev_ = prev; }
|
||||||
void DisplayPage::set_next(DisplayPage *next) { this->next_ = next; }
|
void DisplayPage::set_next(DisplayPage *next) { this->next_ = next; }
|
||||||
const display_writer_t &DisplayPage::get_writer() const { return this->writer_; }
|
const display_writer_t &DisplayPage::get_writer() const { return this->writer_; }
|
||||||
|
|
||||||
|
const LogString *text_align_to_string(TextAlign textalign) {
|
||||||
|
switch (textalign) {
|
||||||
|
case TextAlign::TOP_LEFT:
|
||||||
|
return LOG_STR("TOP_LEFT");
|
||||||
|
case TextAlign::TOP_CENTER:
|
||||||
|
return LOG_STR("TOP_CENTER");
|
||||||
|
case TextAlign::TOP_RIGHT:
|
||||||
|
return LOG_STR("TOP_RIGHT");
|
||||||
|
case TextAlign::CENTER_LEFT:
|
||||||
|
return LOG_STR("CENTER_LEFT");
|
||||||
|
case TextAlign::CENTER:
|
||||||
|
return LOG_STR("CENTER");
|
||||||
|
case TextAlign::CENTER_RIGHT:
|
||||||
|
return LOG_STR("CENTER_RIGHT");
|
||||||
|
case TextAlign::BASELINE_LEFT:
|
||||||
|
return LOG_STR("BASELINE_LEFT");
|
||||||
|
case TextAlign::BASELINE_CENTER:
|
||||||
|
return LOG_STR("BASELINE_CENTER");
|
||||||
|
case TextAlign::BASELINE_RIGHT:
|
||||||
|
return LOG_STR("BASELINE_RIGHT");
|
||||||
|
case TextAlign::BOTTOM_LEFT:
|
||||||
|
return LOG_STR("BOTTOM_LEFT");
|
||||||
|
case TextAlign::BOTTOM_CENTER:
|
||||||
|
return LOG_STR("BOTTOM_CENTER");
|
||||||
|
case TextAlign::BOTTOM_RIGHT:
|
||||||
|
return LOG_STR("BOTTOM_RIGHT");
|
||||||
|
default:
|
||||||
|
return LOG_STR("UNKNOWN");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace display
|
} // namespace display
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "esphome/core/color.h"
|
#include "esphome/core/color.h"
|
||||||
#include "esphome/core/automation.h"
|
#include "esphome/core/automation.h"
|
||||||
#include "esphome/core/time.h"
|
#include "esphome/core/time.h"
|
||||||
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
#ifdef USE_GRAPH
|
#ifdef USE_GRAPH
|
||||||
#include "esphome/components/graph/graph.h"
|
#include "esphome/components/graph/graph.h"
|
||||||
|
@ -631,5 +632,7 @@ class DisplayOnPageChangeTrigger : public Trigger<DisplayPage *, DisplayPage *>
|
||||||
DisplayPage *to_{nullptr};
|
DisplayPage *to_{nullptr};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const LogString *text_align_to_string(TextAlign textalign);
|
||||||
|
|
||||||
} // namespace display
|
} // namespace display
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
|
Loading…
Reference in a new issue