1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-18 07:45:56 +00:00
This commit is contained in:
Otto Winter
2019-04-24 23:49:02 +02:00
parent 0a0713f0e2
commit 766f6c045d
44 changed files with 1202 additions and 592 deletions

View File

@@ -304,4 +304,9 @@ float clamp(float val, float min, float max) {
}
float lerp(float completion, float start, float end) { return start + (end - start) * completion; }
bool str_startswith(const std::string &full, const std::string &start) { return full.rfind(start, 0) == 0; }
bool str_endswith(const std::string &full, const std::string &ending) {
return full.rfind(ending) == (full.size() - ending.size());
}
} // namespace esphome