mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 09:17:46 +01:00
commit
c0523590b4
3 changed files with 4 additions and 4 deletions
|
@ -235,7 +235,7 @@ float DallasTemperatureSensor::get_temp_c() {
|
||||||
|
|
||||||
return temp / 128.0f;
|
return temp / 128.0f;
|
||||||
}
|
}
|
||||||
std::string DallasTemperatureSensor::unique_id() { return "dallas-" + str_upper_case(format_hex(this->address_)); }
|
std::string DallasTemperatureSensor::unique_id() { return "dallas-" + str_lower_case(format_hex(this->address_)); }
|
||||||
|
|
||||||
} // namespace dallas
|
} // namespace dallas
|
||||||
} // namespace esphome
|
} // namespace esphome
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2022.1.2"
|
__version__ = "2022.1.3"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
|
|
||||||
|
|
|
@ -316,8 +316,8 @@ template<int (*fn)(int)> std::string str_ctype_transform(const std::string &str)
|
||||||
std::transform(str.begin(), str.end(), result.begin(), [](unsigned char ch) { return fn(ch); });
|
std::transform(str.begin(), str.end(), result.begin(), [](unsigned char ch) { return fn(ch); });
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
std::string str_lower_case(const std::string &str) { return str_ctype_transform<std::toupper>(str); }
|
std::string str_lower_case(const std::string &str) { return str_ctype_transform<std::tolower>(str); }
|
||||||
std::string str_upper_case(const std::string &str) { return str_ctype_transform<std::tolower>(str); }
|
std::string str_upper_case(const std::string &str) { return str_ctype_transform<std::toupper>(str); }
|
||||||
std::string str_snake_case(const std::string &str) {
|
std::string str_snake_case(const std::string &str) {
|
||||||
std::string result;
|
std::string result;
|
||||||
result.resize(str.length());
|
result.resize(str.length());
|
||||||
|
|
Loading…
Reference in a new issue